module.exports = /******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 43323: /***/ (function(module) { "use strict"; module.exports = {"version":"4.3.0"}; /***/ }), /***/ 77591: /***/ (function(module) { "use strict"; module.exports = {"i8":"5.1.1"}; /***/ }), /***/ 35464: /***/ (function(module) { "use strict"; module.exports = {"i8":"4.3.0"}; /***/ }), /***/ 53243: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-updatestreamcontrol+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-updatestreamparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomdeleted\"]},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dwd\"]},\"application/atsc-dynamic-event-message\":{\"source\":\"iana\"},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"held\"]},\"application/atsc-rdt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsat\"]},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xcs\"]},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/captive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cbor\":{\"source\":\"iana\"},\"application/cbor-seq\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdfx\"]},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clr\":{\"source\":\"iana\"},\"application/clue+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dots+cbor\":{\"source\":\"iana\"},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es\",\"ecma\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/elm+json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/elm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.cap+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emotionml\"]},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fdt\"]},\"application/fhir+json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/flexfec\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"its\"]},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jscalendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lgr\"]},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lpf+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mipc\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"maei\"]},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musd\"]},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/multipart-core\":{\"source\":\"iana\"},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\",\"charset\":\"US-ASCII\"},\"application/news-groupinfo\":{\"source\":\"iana\",\"charset\":\"US-ASCII\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\",\"extensions\":[\"cjs\"]},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/opc-nodeset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"relo\"]},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"provx\"]},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.cyn\":{\"source\":\"iana\",\"charset\":\"7-BIT\"},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/pvd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rapd\"]},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sls\"]},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rusd\"]},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sarif+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sbe\":{\"source\":\"iana\"},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"senmlx\"]},\"application/senml-etch+cbor\":{\"source\":\"iana\"},\"application/senml-etch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sensmlx\"]},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/sipc\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/swid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"swidtag\"]},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/td+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/toml\":{\"compressible\":true,\"extensions\":[\"toml\"]},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttml\"]},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ubjson\":{\"compressible\":false,\"extensions\":[\"ubj\"]},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsheet\"]},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"td\"]},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"1km\"]},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.interworking-data\":{\"source\":\"iana\"},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata-pagedef\":{\"source\":\"iana\"},\"application/vnd.afpc.cmoca-cmresource\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-charset\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codedfont\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codepage\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-cmtable\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-formdef\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-mediummap\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-objectcontainer\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-overlay\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-pagesegment\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.ota\":{\"source\":\"iana\"},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.aplextor.warrp+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"key\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmml\"]},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.error\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.bpf\":{\"source\":\"iana\"},\"application/vnd.bpf3\":{\"source\":\"iana\"},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.ciedi\":{\"source\":\"iana\"},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.cryptii.pipe+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.crypto-shade-file\":{\"source\":\"iana\"},\"application/vnd.cryptomator.encrypted\":{\"source\":\"iana\"},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.cyclonedx+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cyclonedx+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.d3m-dataset\":{\"source\":\"iana\"},\"application/vnd.d3m-problem\":{\"source\":\"iana\"},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dbf\":{\"source\":\"iana\",\"extensions\":[\"dbf\"]},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbisl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.ficlab.flb+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.gentics.grd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.slides\":{\"source\":\"iana\"},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.iso11783-10+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las\":{\"source\":\"iana\"},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.laszip\":{\"source\":\"iana\"},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.logipipe.circuit+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.loom\":{\"source\":\"iana\"},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nebumind.line\":{\"source\":\"iana\"},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ac\"]},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oci.image.manifest.v1+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+cbor\":{\"source\":\"iana\"},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"obgx\"]},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osm\"]},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\",\"extensions\":[\"rar\"]},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sar\":{\"source\":\"iana\"},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.seis+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shade-save-file\":{\"source\":\"iana\"},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.shopkick+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.shp\":{\"source\":\"iana\"},\"application/vnd.shx\":{\"source\":\"iana\"},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.snesdev-page-table\":{\"source\":\"iana\"},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fo\"]},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.sycle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"ddf\"]},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.ves.encrypted\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.dpp\":{\"source\":\"iana\"},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-keepass2\":{\"extensions\":[\"kdbx\"]},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-pki-message\":{\"source\":\"iana\"},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"iana\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-x509-ca-ra-cert\":{\"source\":\"iana\"},\"application/x-x509-next-ca-cert\":{\"source\":\"iana\"},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xav\"]},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xca\"]},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xel\"]},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xns\"]},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsl\",\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\",\"extensions\":[\"amr\"]},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/flexfec\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/mhas\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\",\"extensions\":[\"mxmf\"]},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\",\"opus\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/scip\":{\"source\":\"iana\"},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sofa\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tetra_acelp_bb\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/tsvcis\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/avif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"avif\"]},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/hej2k\":{\"source\":\"iana\",\"extensions\":[\"hej2\"]},\"image/hsj2\":{\"source\":\"iana\",\"extensions\":[\"hsj2\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jph\":{\"source\":\"iana\",\"extensions\":[\"jph\"]},\"image/jphc\":{\"source\":\"iana\",\"extensions\":[\"jhc\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/jxra\":{\"source\":\"iana\",\"extensions\":[\"jxra\"]},\"image/jxrs\":{\"source\":\"iana\",\"extensions\":[\"jxrs\"]},\"image/jxs\":{\"source\":\"iana\",\"extensions\":[\"jxs\"]},\"image/jxsc\":{\"source\":\"iana\",\"extensions\":[\"jxsc\"]},\"image/jxsi\":{\"source\":\"iana\",\"extensions\":[\"jxsi\"]},\"image/jxss\":{\"source\":\"iana\",\"extensions\":[\"jxss\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/ktx2\":{\"source\":\"iana\",\"extensions\":[\"ktx2\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-dds\":{\"extensions\":[\"dds\"]},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.pco.b16\":{\"source\":\"iana\",\"extensions\":[\"b16\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/e57\":{\"source\":\"iana\"},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/mtl\":{\"source\":\"iana\",\"extensions\":[\"mtl\"]},\"model/obj\":{\"source\":\"iana\",\"extensions\":[\"obj\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.sap.vds\":{\"source\":\"iana\",\"extensions\":[\"vds\"]},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\"},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/cql\":{\"source\":\"iana\"},\"text/cql-expression\":{\"source\":\"iana\"},\"text/cql-identifier\":{\"source\":\"iana\"},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/fhirpath\":{\"source\":\"iana\"},\"text/flexfec\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/gff3\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\",\"charset\":\"UTF-8\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\",\"charset\":\"UTF-8\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shaclc\":{\"source\":\"iana\"},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/spdx\":{\"source\":\"iana\",\"extensions\":[\"spdx\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\",\"charset\":\"UTF-8\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\",\"charset\":\"UTF-8\"},\"text/vnd.ficlab.flt\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hans\":{\"source\":\"iana\"},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sosi\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\",\"charset\":\"UTF-8\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/av1\":{\"source\":\"iana\"},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/ffv1\":{\"source\":\"iana\"},\"video/flexfec\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\",\"extensions\":[\"m4s\"]},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/scip\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vnd.youtube.yt\":{\"source\":\"iana\"},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}}"); /***/ }), /***/ 87168: /***/ (function(module) { "use strict"; module.exports = {"i8":"5.64.4"}; /***/ }), /***/ 1863: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"Amd\":{\"description\":\"Set the value of `require.amd` and `define.amd`. Or disable AMD support.\",\"anyOf\":[{\"description\":\"You can pass `false` to disable AMD support.\",\"enum\":[false]},{\"description\":\"You can pass an object to set the value of `require.amd` and `define.amd`.\",\"type\":\"object\"}]},\"AssetFilterItemTypes\":{\"description\":\"Filtering value, regexp or function.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((name: string, asset: import('../lib/stats/DefaultStatsFactoryPlugin').StatsAsset) => boolean)\"}]},\"AssetFilterTypes\":{\"description\":\"Filtering modules.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Rule to filter.\",\"cli\":{\"helper\":true},\"oneOf\":[{\"$ref\":\"#/definitions/AssetFilterItemTypes\"}]}},{\"$ref\":\"#/definitions/AssetFilterItemTypes\"}]},\"AssetGeneratorDataUrl\":{\"description\":\"The options for data url generator.\",\"anyOf\":[{\"$ref\":\"#/definitions/AssetGeneratorDataUrlOptions\"},{\"$ref\":\"#/definitions/AssetGeneratorDataUrlFunction\"}]},\"AssetGeneratorDataUrlFunction\":{\"description\":\"Function that executes for module and should return an DataUrl string.\",\"instanceof\":\"Function\",\"tsType\":\"((source: string | Buffer, context: { filename: string, module: import('../lib/Module') }) => string)\"},\"AssetGeneratorDataUrlOptions\":{\"description\":\"Options object for data url generation.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"encoding\":{\"description\":\"Asset encoding (defaults to base64).\",\"enum\":[false,\"base64\"]},\"mimetype\":{\"description\":\"Asset mimetype (getting from file extension by default).\",\"type\":\"string\"}}},\"AssetGeneratorOptions\":{\"description\":\"Generator options for asset modules.\",\"type\":\"object\",\"implements\":[\"#/definitions/AssetInlineGeneratorOptions\",\"#/definitions/AssetResourceGeneratorOptions\"],\"additionalProperties\":false,\"properties\":{\"dataUrl\":{\"$ref\":\"#/definitions/AssetGeneratorDataUrl\"},\"emit\":{\"description\":\"Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.\",\"type\":\"boolean\"},\"filename\":{\"$ref\":\"#/definitions/FilenameTemplate\"},\"publicPath\":{\"$ref\":\"#/definitions/RawPublicPath\"}}},\"AssetInlineGeneratorOptions\":{\"description\":\"Generator options for asset/inline modules.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"dataUrl\":{\"$ref\":\"#/definitions/AssetGeneratorDataUrl\"}}},\"AssetModuleFilename\":{\"description\":\"The filename of asset modules as relative path inside the 'output.path' directory.\",\"anyOf\":[{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((pathData: import(\\\"../lib/Compilation\\\").PathData, assetInfo?: import(\\\"../lib/Compilation\\\").AssetInfo) => string)\"}]},\"AssetParserDataUrlFunction\":{\"description\":\"Function that executes for module and should return whenever asset should be inlined as DataUrl.\",\"instanceof\":\"Function\",\"tsType\":\"((source: string | Buffer, context: { filename: string, module: import('../lib/Module') }) => boolean)\"},\"AssetParserDataUrlOptions\":{\"description\":\"Options object for DataUrl condition.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"maxSize\":{\"description\":\"Maximum size of asset that should be inline as modules. Default: 8kb.\",\"type\":\"number\"}}},\"AssetParserOptions\":{\"description\":\"Parser options for asset modules.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"dataUrlCondition\":{\"description\":\"The condition for inlining the asset as DataUrl.\",\"anyOf\":[{\"$ref\":\"#/definitions/AssetParserDataUrlOptions\"},{\"$ref\":\"#/definitions/AssetParserDataUrlFunction\"}]}}},\"AssetResourceGeneratorOptions\":{\"description\":\"Generator options for asset/resource modules.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"emit\":{\"description\":\"Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.\",\"type\":\"boolean\"},\"filename\":{\"$ref\":\"#/definitions/FilenameTemplate\"},\"publicPath\":{\"$ref\":\"#/definitions/RawPublicPath\"}}},\"AuxiliaryComment\":{\"description\":\"Add a comment in the UMD wrapper.\",\"anyOf\":[{\"description\":\"Append the same comment above each import style.\",\"type\":\"string\"},{\"$ref\":\"#/definitions/LibraryCustomUmdCommentObject\"}]},\"Bail\":{\"description\":\"Report the first error as a hard error instead of tolerating it.\",\"type\":\"boolean\"},\"CacheOptions\":{\"description\":\"Cache generated modules and chunks to improve performance for multiple incremental builds.\",\"anyOf\":[{\"description\":\"Enable in memory caching.\",\"enum\":[true]},{\"$ref\":\"#/definitions/CacheOptionsNormalized\"}]},\"CacheOptionsNormalized\":{\"description\":\"Cache generated modules and chunks to improve performance for multiple incremental builds.\",\"anyOf\":[{\"description\":\"Disable caching.\",\"enum\":[false]},{\"$ref\":\"#/definitions/MemoryCacheOptions\"},{\"$ref\":\"#/definitions/FileCacheOptions\"}]},\"Charset\":{\"description\":\"Add charset attribute for script tag.\",\"type\":\"boolean\"},\"ChunkFilename\":{\"description\":\"Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.\",\"oneOf\":[{\"$ref\":\"#/definitions/FilenameTemplate\"}]},\"ChunkFormat\":{\"description\":\"The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"array-push\",\"commonjs\",\"module\",false]},{\"type\":\"string\"}]},\"ChunkLoadTimeout\":{\"description\":\"Number of milliseconds before chunk request expires.\",\"type\":\"number\"},\"ChunkLoading\":{\"description\":\"The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).\",\"anyOf\":[{\"enum\":[false]},{\"$ref\":\"#/definitions/ChunkLoadingType\"}]},\"ChunkLoadingGlobal\":{\"description\":\"The global variable used by webpack for loading of chunks.\",\"type\":\"string\"},\"ChunkLoadingType\":{\"description\":\"The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"jsonp\",\"import-scripts\",\"require\",\"async-node\",\"import\"]},{\"type\":\"string\"}]},\"Clean\":{\"description\":\"Clean the output directory before emit.\",\"anyOf\":[{\"type\":\"boolean\"},{\"$ref\":\"#/definitions/CleanOptions\"}]},\"CleanOptions\":{\"description\":\"Advanced options for cleaning assets.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"dry\":{\"description\":\"Log the assets that should be removed instead of deleting them.\",\"type\":\"boolean\"},\"keep\":{\"description\":\"Keep these assets.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((filename: string) => boolean)\"}]}}},\"CompareBeforeEmit\":{\"description\":\"Check if to be emitted file already exists and have the same content before writing to output filesystem.\",\"type\":\"boolean\"},\"Context\":{\"description\":\"The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.\",\"type\":\"string\",\"absolutePath\":true},\"CrossOriginLoading\":{\"description\":\"This option enables cross-origin loading of chunks.\",\"enum\":[false,\"anonymous\",\"use-credentials\"]},\"Dependencies\":{\"description\":\"References to other configurations to depend on.\",\"type\":\"array\",\"items\":{\"description\":\"References to another configuration to depend on.\",\"type\":\"string\"}},\"DevServer\":{\"description\":\"Options for the webpack-dev-server.\",\"type\":\"object\"},\"DevTool\":{\"description\":\"A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).\",\"anyOf\":[{\"enum\":[false,\"eval\"]},{\"type\":\"string\",\"pattern\":\"^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$\"}]},\"DevtoolFallbackModuleFilenameTemplate\":{\"description\":\"Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.\",\"anyOf\":[{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"DevtoolModuleFilenameTemplate\":{\"description\":\"Filename template string of function for the sources array in a generated SourceMap.\",\"anyOf\":[{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"DevtoolNamespace\":{\"description\":\"Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.\",\"type\":\"string\"},\"EmptyGeneratorOptions\":{\"description\":\"No generator options are supported for this module type.\",\"type\":\"object\",\"additionalProperties\":false},\"EmptyParserOptions\":{\"description\":\"No parser options are supported for this module type.\",\"type\":\"object\",\"additionalProperties\":false},\"EnabledChunkLoadingTypes\":{\"description\":\"List of chunk loading types enabled for use by entry points.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/ChunkLoadingType\"}},\"EnabledLibraryTypes\":{\"description\":\"List of library types enabled for use by entry points.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/LibraryType\"}},\"EnabledWasmLoadingTypes\":{\"description\":\"List of wasm loading types enabled for use by entry points.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/WasmLoadingType\"}},\"Entry\":{\"description\":\"The entry point(s) of the compilation.\",\"anyOf\":[{\"$ref\":\"#/definitions/EntryDynamic\"},{\"$ref\":\"#/definitions/EntryStatic\"}]},\"EntryDescription\":{\"description\":\"An object with entry point description.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"asyncChunks\":{\"description\":\"Enable/disable creating async chunks that are loaded on demand.\",\"type\":\"boolean\"},\"chunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"dependOn\":{\"description\":\"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.\",\"anyOf\":[{\"description\":\"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.\",\"type\":\"array\",\"items\":{\"description\":\"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1,\"uniqueItems\":true},{\"description\":\"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.\",\"type\":\"string\",\"minLength\":1}]},\"filename\":{\"$ref\":\"#/definitions/EntryFilename\"},\"import\":{\"$ref\":\"#/definitions/EntryItem\"},\"layer\":{\"$ref\":\"#/definitions/Layer\"},\"library\":{\"$ref\":\"#/definitions/LibraryOptions\"},\"publicPath\":{\"$ref\":\"#/definitions/PublicPath\"},\"runtime\":{\"$ref\":\"#/definitions/EntryRuntime\"},\"wasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"}},\"required\":[\"import\"]},\"EntryDescriptionNormalized\":{\"description\":\"An object with entry point description.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"asyncChunks\":{\"description\":\"Enable/disable creating async chunks that are loaded on demand.\",\"type\":\"boolean\"},\"chunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"dependOn\":{\"description\":\"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.\",\"type\":\"array\",\"items\":{\"description\":\"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1,\"uniqueItems\":true},\"filename\":{\"$ref\":\"#/definitions/Filename\"},\"import\":{\"description\":\"Module(s) that are loaded upon startup. The last one is exported.\",\"type\":\"array\",\"items\":{\"description\":\"Module that is loaded upon startup. Only the last one is exported.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1,\"uniqueItems\":true},\"layer\":{\"$ref\":\"#/definitions/Layer\"},\"library\":{\"$ref\":\"#/definitions/LibraryOptions\"},\"publicPath\":{\"$ref\":\"#/definitions/PublicPath\"},\"runtime\":{\"$ref\":\"#/definitions/EntryRuntime\"},\"wasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"}}},\"EntryDynamic\":{\"description\":\"A Function returning an entry object, an entry string, an entry array or a promise to these things.\",\"instanceof\":\"Function\",\"tsType\":\"(() => EntryStatic | Promise)\"},\"EntryDynamicNormalized\":{\"description\":\"A Function returning a Promise resolving to a normalized entry.\",\"instanceof\":\"Function\",\"tsType\":\"(() => Promise)\"},\"EntryFilename\":{\"description\":\"Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.\",\"oneOf\":[{\"$ref\":\"#/definitions/FilenameTemplate\"}]},\"EntryItem\":{\"description\":\"Module(s) that are loaded upon startup.\",\"anyOf\":[{\"description\":\"All modules are loaded upon startup. The last one is exported.\",\"type\":\"array\",\"items\":{\"description\":\"A module that is loaded upon startup. Only the last one is exported.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1,\"uniqueItems\":true},{\"description\":\"The string is resolved to a module which is loaded upon startup.\",\"type\":\"string\",\"minLength\":1}]},\"EntryNormalized\":{\"description\":\"The entry point(s) of the compilation.\",\"anyOf\":[{\"$ref\":\"#/definitions/EntryDynamicNormalized\"},{\"$ref\":\"#/definitions/EntryStaticNormalized\"}]},\"EntryObject\":{\"description\":\"Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"An entry point with name.\",\"anyOf\":[{\"$ref\":\"#/definitions/EntryItem\"},{\"$ref\":\"#/definitions/EntryDescription\"}]}},\"EntryRuntime\":{\"description\":\"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"minLength\":1}]},\"EntryStatic\":{\"description\":\"A static entry description.\",\"anyOf\":[{\"$ref\":\"#/definitions/EntryObject\"},{\"$ref\":\"#/definitions/EntryUnnamed\"}]},\"EntryStaticNormalized\":{\"description\":\"Multiple entry bundles are created. The key is the entry name. The value is an entry description object.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"An object with entry point description.\",\"oneOf\":[{\"$ref\":\"#/definitions/EntryDescriptionNormalized\"}]}},\"EntryUnnamed\":{\"description\":\"An entry point without name.\",\"oneOf\":[{\"$ref\":\"#/definitions/EntryItem\"}]},\"Environment\":{\"description\":\"The abilities of the environment where the webpack generated code should run.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"arrowFunction\":{\"description\":\"The environment supports arrow functions ('() => { ... }').\",\"type\":\"boolean\"},\"bigIntLiteral\":{\"description\":\"The environment supports BigInt as literal (123n).\",\"type\":\"boolean\"},\"const\":{\"description\":\"The environment supports const and let for variable declarations.\",\"type\":\"boolean\"},\"destructuring\":{\"description\":\"The environment supports destructuring ('{ a, b } = obj').\",\"type\":\"boolean\"},\"dynamicImport\":{\"description\":\"The environment supports an async import() function to import EcmaScript modules.\",\"type\":\"boolean\"},\"forOf\":{\"description\":\"The environment supports 'for of' iteration ('for (const x of array) { ... }').\",\"type\":\"boolean\"},\"module\":{\"description\":\"The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').\",\"type\":\"boolean\"}}},\"Experiments\":{\"description\":\"Enables/Disables experiments (experimental features with relax SemVer compatibility).\",\"type\":\"object\",\"implements\":[\"#/definitions/ExperimentsCommon\"],\"additionalProperties\":false,\"properties\":{\"asyncWebAssembly\":{\"description\":\"Support WebAssembly as asynchronous EcmaScript Module.\",\"type\":\"boolean\"},\"backCompat\":{\"description\":\"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.\",\"type\":\"boolean\"},\"buildHttp\":{\"description\":\"Build http(s): urls using a lockfile and resource content cache.\",\"anyOf\":[{\"$ref\":\"#/definitions/HttpUriAllowedUris\"},{\"$ref\":\"#/definitions/HttpUriOptions\"}]},\"cacheUnaffected\":{\"description\":\"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.\",\"type\":\"boolean\"},\"futureDefaults\":{\"description\":\"Apply defaults of next major version.\",\"type\":\"boolean\"},\"layers\":{\"description\":\"Enable module layers.\",\"type\":\"boolean\"},\"lazyCompilation\":{\"description\":\"Compile entrypoints and import()s only when they are accessed.\",\"anyOf\":[{\"type\":\"boolean\"},{\"$ref\":\"#/definitions/LazyCompilationOptions\"}]},\"outputModule\":{\"description\":\"Allow output javascript files as module source type.\",\"type\":\"boolean\"},\"syncWebAssembly\":{\"description\":\"Support WebAssembly as synchronous EcmaScript Module (outdated).\",\"type\":\"boolean\"},\"topLevelAwait\":{\"description\":\"Allow using top-level-await in EcmaScript Modules.\",\"type\":\"boolean\"}}},\"ExperimentsCommon\":{\"description\":\"Enables/Disables experiments (experimental features with relax SemVer compatibility).\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"asyncWebAssembly\":{\"description\":\"Support WebAssembly as asynchronous EcmaScript Module.\",\"type\":\"boolean\"},\"backCompat\":{\"description\":\"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.\",\"type\":\"boolean\"},\"cacheUnaffected\":{\"description\":\"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.\",\"type\":\"boolean\"},\"futureDefaults\":{\"description\":\"Apply defaults of next major version.\",\"type\":\"boolean\"},\"layers\":{\"description\":\"Enable module layers.\",\"type\":\"boolean\"},\"outputModule\":{\"description\":\"Allow output javascript files as module source type.\",\"type\":\"boolean\"},\"syncWebAssembly\":{\"description\":\"Support WebAssembly as synchronous EcmaScript Module (outdated).\",\"type\":\"boolean\"},\"topLevelAwait\":{\"description\":\"Allow using top-level-await in EcmaScript Modules.\",\"type\":\"boolean\"}}},\"ExperimentsNormalized\":{\"description\":\"Enables/Disables experiments (experimental features with relax SemVer compatibility).\",\"type\":\"object\",\"implements\":[\"#/definitions/ExperimentsCommon\"],\"additionalProperties\":false,\"properties\":{\"asyncWebAssembly\":{\"description\":\"Support WebAssembly as asynchronous EcmaScript Module.\",\"type\":\"boolean\"},\"backCompat\":{\"description\":\"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.\",\"type\":\"boolean\"},\"buildHttp\":{\"description\":\"Build http(s): urls using a lockfile and resource content cache.\",\"oneOf\":[{\"$ref\":\"#/definitions/HttpUriOptions\"}]},\"cacheUnaffected\":{\"description\":\"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.\",\"type\":\"boolean\"},\"futureDefaults\":{\"description\":\"Apply defaults of next major version.\",\"type\":\"boolean\"},\"layers\":{\"description\":\"Enable module layers.\",\"type\":\"boolean\"},\"lazyCompilation\":{\"description\":\"Compile entrypoints and import()s only when they are accessed.\",\"oneOf\":[{\"$ref\":\"#/definitions/LazyCompilationOptions\"}]},\"outputModule\":{\"description\":\"Allow output javascript files as module source type.\",\"type\":\"boolean\"},\"syncWebAssembly\":{\"description\":\"Support WebAssembly as synchronous EcmaScript Module (outdated).\",\"type\":\"boolean\"},\"topLevelAwait\":{\"description\":\"Allow using top-level-await in EcmaScript Modules.\",\"type\":\"boolean\"}}},\"ExternalItem\":{\"description\":\"Specify dependency that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.\",\"anyOf\":[{\"description\":\"Every matched dependency becomes external.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"An exact matched dependency becomes external. The same string is used as external dependency.\",\"type\":\"string\"},{\"description\":\"If an dependency matches exactly a property of the object, the property value is used as dependency.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/ExternalItemValue\"},\"properties\":{\"byLayer\":{\"description\":\"Specify externals depending on the layer.\",\"anyOf\":[{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/ExternalItem\"}},{\"instanceof\":\"Function\",\"tsType\":\"((layer: string | null) => ExternalItem)\"}]}}},{\"description\":\"The function is called on each dependency (`function(context, request, callback(err, result))`).\",\"instanceof\":\"Function\",\"tsType\":\"(((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue) => void) => void) | ((data: ExternalItemFunctionData) => Promise))\"}]},\"ExternalItemFunctionData\":{\"description\":\"Data object passed as argument when a function is set for 'externals'.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"context\":{\"description\":\"The directory in which the request is placed.\",\"type\":\"string\"},\"contextInfo\":{\"description\":\"Contextual information.\",\"type\":\"object\",\"tsType\":\"import('../lib/ModuleFactory').ModuleFactoryCreateDataContextInfo\"},\"dependencyType\":{\"description\":\"The category of the referencing dependencies.\",\"type\":\"string\"},\"getResolve\":{\"description\":\"Get a resolve function with the current resolver options.\",\"instanceof\":\"Function\",\"tsType\":\"((options?: ResolveOptions) => ((context: string, request: string, callback: (err?: Error, result?: string) => void) => void) | ((context: string, request: string) => Promise))\"},\"request\":{\"description\":\"The request as written by the user in the require/import expression/statement.\",\"type\":\"string\"}}},\"ExternalItemValue\":{\"description\":\"The dependency used for the external.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A part of the target of the external.\",\"type\":\"string\",\"minLength\":1}},{\"description\":\"`true`: The dependency name is used as target of the external.\",\"type\":\"boolean\"},{\"description\":\"The target of the external.\",\"type\":\"string\"},{\"type\":\"object\"}]},\"Externals\":{\"description\":\"Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/ExternalItem\"}},{\"$ref\":\"#/definitions/ExternalItem\"}]},\"ExternalsPresets\":{\"description\":\"Enable presets of externals for specific targets.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"electron\":{\"description\":\"Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.\",\"type\":\"boolean\"},\"electronMain\":{\"description\":\"Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.\",\"type\":\"boolean\"},\"electronPreload\":{\"description\":\"Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.\",\"type\":\"boolean\"},\"electronRenderer\":{\"description\":\"Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.\",\"type\":\"boolean\"},\"node\":{\"description\":\"Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.\",\"type\":\"boolean\"},\"nwjs\":{\"description\":\"Treat NW.js legacy nw.gui module as external and load it via require() when used.\",\"type\":\"boolean\"},\"web\":{\"description\":\"Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).\",\"type\":\"boolean\"},\"webAsync\":{\"description\":\"Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).\",\"type\":\"boolean\"}}},\"ExternalsType\":{\"description\":\"Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).\",\"enum\":[\"var\",\"module\",\"assign\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\",\"promise\",\"import\",\"script\",\"node-commonjs\"]},\"FileCacheOptions\":{\"description\":\"Options object for persistent file-based caching.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"allowCollectingMemory\":{\"description\":\"Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.\",\"type\":\"boolean\"},\"buildDependencies\":{\"description\":\"Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"List of dependencies the build depends on.\",\"type\":\"array\",\"items\":{\"description\":\"Request to a dependency (resolved as directory relative to the context directory).\",\"type\":\"string\",\"minLength\":1}}},\"cacheDirectory\":{\"description\":\"Base directory for the cache (defaults to node_modules/.cache/webpack).\",\"type\":\"string\",\"absolutePath\":true},\"cacheLocation\":{\"description\":\"Locations for the cache (defaults to cacheDirectory / name).\",\"type\":\"string\",\"absolutePath\":true},\"compression\":{\"description\":\"Compression type used for the cache files.\",\"enum\":[false,\"gzip\",\"brotli\"]},\"hashAlgorithm\":{\"description\":\"Algorithm used for generation the hash (see node.js crypto package).\",\"type\":\"string\"},\"idleTimeout\":{\"description\":\"Time in ms after which idle period the cache storing should happen.\",\"type\":\"number\",\"minimum\":0},\"idleTimeoutAfterLargeChanges\":{\"description\":\"Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).\",\"type\":\"number\",\"minimum\":0},\"idleTimeoutForInitialStore\":{\"description\":\"Time in ms after which idle period the initial cache storing should happen.\",\"type\":\"number\",\"minimum\":0},\"immutablePaths\":{\"description\":\"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.\",\"type\":\"array\",\"items\":{\"description\":\"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.\",\"anyOf\":[{\"description\":\"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"A path to an immutable directory (usually a package manager cache directory).\",\"type\":\"string\",\"absolutePath\":true,\"minLength\":1}]}},\"managedPaths\":{\"description\":\"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.\",\"type\":\"array\",\"items\":{\"description\":\"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.\",\"anyOf\":[{\"description\":\"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"A path to a managed directory (usually a node_modules directory).\",\"type\":\"string\",\"absolutePath\":true,\"minLength\":1}]}},\"maxAge\":{\"description\":\"Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).\",\"type\":\"number\",\"minimum\":0},\"maxMemoryGenerations\":{\"description\":\"Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.\",\"type\":\"number\",\"minimum\":0},\"memoryCacheUnaffected\":{\"description\":\"Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Name for the cache. Different names will lead to different coexisting caches.\",\"type\":\"string\"},\"profile\":{\"description\":\"Track and log detailed timing information for individual cache items.\",\"type\":\"boolean\"},\"store\":{\"description\":\"When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).\",\"enum\":[\"pack\"]},\"type\":{\"description\":\"Filesystem caching.\",\"enum\":[\"filesystem\"]},\"version\":{\"description\":\"Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.\",\"type\":\"string\"}},\"required\":[\"type\"]},\"Filename\":{\"description\":\"Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.\",\"oneOf\":[{\"$ref\":\"#/definitions/FilenameTemplate\"}]},\"FilenameTemplate\":{\"description\":\"Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.\",\"anyOf\":[{\"type\":\"string\",\"absolutePath\":false,\"minLength\":1},{\"instanceof\":\"Function\",\"tsType\":\"((pathData: import(\\\"../lib/Compilation\\\").PathData, assetInfo?: import(\\\"../lib/Compilation\\\").AssetInfo) => string)\"}]},\"FilterItemTypes\":{\"description\":\"Filtering value, regexp or function.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((value: string) => boolean)\"}]},\"FilterTypes\":{\"description\":\"Filtering values.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Rule to filter.\",\"cli\":{\"helper\":true},\"oneOf\":[{\"$ref\":\"#/definitions/FilterItemTypes\"}]}},{\"$ref\":\"#/definitions/FilterItemTypes\"}]},\"GeneratorOptionsByModuleType\":{\"description\":\"Specify options for each generator.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Options for generating.\",\"type\":\"object\",\"additionalProperties\":true},\"properties\":{\"asset\":{\"$ref\":\"#/definitions/AssetGeneratorOptions\"},\"asset/inline\":{\"$ref\":\"#/definitions/AssetInlineGeneratorOptions\"},\"asset/resource\":{\"$ref\":\"#/definitions/AssetResourceGeneratorOptions\"},\"javascript\":{\"$ref\":\"#/definitions/EmptyGeneratorOptions\"},\"javascript/auto\":{\"$ref\":\"#/definitions/EmptyGeneratorOptions\"},\"javascript/dynamic\":{\"$ref\":\"#/definitions/EmptyGeneratorOptions\"},\"javascript/esm\":{\"$ref\":\"#/definitions/EmptyGeneratorOptions\"}}},\"GlobalObject\":{\"description\":\"An expression which is used to address the global object/scope in runtime code.\",\"type\":\"string\",\"minLength\":1},\"HashDigest\":{\"description\":\"Digest type used for the hash.\",\"type\":\"string\"},\"HashDigestLength\":{\"description\":\"Number of chars which are used for the hash.\",\"type\":\"number\",\"minimum\":1},\"HashFunction\":{\"description\":\"Algorithm used for generation the hash (see node.js crypto package).\",\"anyOf\":[{\"type\":\"string\",\"minLength\":1},{\"instanceof\":\"Function\",\"tsType\":\"typeof import('../lib/util/Hash')\"}]},\"HashSalt\":{\"description\":\"Any string which is added to the hash to salt it.\",\"type\":\"string\",\"minLength\":1},\"HotUpdateChunkFilename\":{\"description\":\"The filename of the Hot Update Chunks. They are inside the output.path directory.\",\"type\":\"string\",\"absolutePath\":false},\"HotUpdateGlobal\":{\"description\":\"The global variable used by webpack for loading of hot update chunks.\",\"type\":\"string\"},\"HotUpdateMainFilename\":{\"description\":\"The filename of the Hot Update Main File. It is inside the 'output.path' directory.\",\"type\":\"string\",\"absolutePath\":false},\"HttpUriAllowedUris\":{\"description\":\"List of allowed URIs for building http resources.\",\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/HttpUriOptionsAllowedUris\"}]},\"HttpUriOptions\":{\"description\":\"Options for building http resources.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"allowedUris\":{\"$ref\":\"#/definitions/HttpUriOptionsAllowedUris\"},\"cacheLocation\":{\"description\":\"Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"absolutePath\":true}]},\"frozen\":{\"description\":\"When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.\",\"type\":\"boolean\"},\"lockfileLocation\":{\"description\":\"Location of the lockfile.\",\"type\":\"string\",\"absolutePath\":true},\"upgrade\":{\"description\":\"When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.\",\"type\":\"boolean\"}},\"required\":[\"allowedUris\"]},\"HttpUriOptionsAllowedUris\":{\"description\":\"List of allowed URIs (resp. the beginning of them).\",\"type\":\"array\",\"items\":{\"description\":\"List of allowed URIs (resp. the beginning of them).\",\"anyOf\":[{\"description\":\"Allowed URI pattern.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"Allowed URI (resp. the beginning of it).\",\"type\":\"string\",\"pattern\":\"^https?://\"},{\"description\":\"Allowed URI filter function.\",\"instanceof\":\"Function\",\"tsType\":\"((uri: string) => boolean)\"}]}},\"IgnoreWarnings\":{\"description\":\"Ignore specific warnings.\",\"type\":\"array\",\"items\":{\"description\":\"Ignore specific warnings.\",\"anyOf\":[{\"description\":\"A RegExp to select the warning message.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"file\":{\"description\":\"A RegExp to select the origin file for the warning.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},\"message\":{\"description\":\"A RegExp to select the warning message.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},\"module\":{\"description\":\"A RegExp to select the origin module for the warning.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"}}},{\"description\":\"A custom function to select warnings based on the raw warning instance.\",\"instanceof\":\"Function\",\"tsType\":\"((warning: import('../lib/WebpackError'), compilation: import('../lib/Compilation')) => boolean)\"}]}},\"IgnoreWarningsNormalized\":{\"description\":\"Ignore specific warnings.\",\"type\":\"array\",\"items\":{\"description\":\"A function to select warnings based on the raw warning instance.\",\"instanceof\":\"Function\",\"tsType\":\"((warning: import('../lib/WebpackError'), compilation: import('../lib/Compilation')) => boolean)\"}},\"Iife\":{\"description\":\"Wrap javascript code into IIFE's to avoid leaking into global scope.\",\"type\":\"boolean\"},\"ImportFunctionName\":{\"description\":\"The name of the native import() function (can be exchanged for a polyfill).\",\"type\":\"string\"},\"ImportMetaName\":{\"description\":\"The name of the native import.meta object (can be exchanged for a polyfill).\",\"type\":\"string\"},\"InfrastructureLogging\":{\"description\":\"Options for infrastructure level logging.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"appendOnly\":{\"description\":\"Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.\",\"type\":\"boolean\"},\"colors\":{\"description\":\"Enables/Disables colorful output. This option is only used when no custom console is provided.\",\"type\":\"boolean\"},\"console\":{\"description\":\"Custom console used for logging.\",\"tsType\":\"Console\"},\"debug\":{\"description\":\"Enable debug logging for specific loggers.\",\"anyOf\":[{\"description\":\"Enable/Disable debug logging for all loggers.\",\"type\":\"boolean\"},{\"$ref\":\"#/definitions/FilterTypes\"}]},\"level\":{\"description\":\"Log level.\",\"enum\":[\"none\",\"error\",\"warn\",\"info\",\"log\",\"verbose\"]},\"stream\":{\"description\":\"Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.\",\"tsType\":\"NodeJS.WritableStream\"}}},\"JavascriptParserOptions\":{\"description\":\"Parser options for javascript modules.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"amd\":{\"$ref\":\"#/definitions/Amd\"},\"browserify\":{\"description\":\"Enable/disable special handling for browserify bundles.\",\"type\":\"boolean\"},\"commonjs\":{\"description\":\"Enable/disable parsing of CommonJs syntax.\",\"type\":\"boolean\"},\"commonjsMagicComments\":{\"description\":\"Enable/disable parsing of magic comments in CommonJs syntax.\",\"type\":\"boolean\"},\"exportsPresence\":{\"description\":\"Specifies the behavior of invalid export names in \\\"import ... from ...\\\" and \\\"export ... from ...\\\".\",\"enum\":[\"error\",\"warn\",\"auto\",false]},\"exprContextCritical\":{\"description\":\"Enable warnings for full dynamic dependencies.\",\"type\":\"boolean\"},\"exprContextRecursive\":{\"description\":\"Enable recursive directory lookup for full dynamic dependencies.\",\"type\":\"boolean\"},\"exprContextRegExp\":{\"description\":\"Sets the default regular expression for full dynamic dependencies.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"boolean\"}]},\"exprContextRequest\":{\"description\":\"Set the default request for full dynamic dependencies.\",\"type\":\"string\"},\"harmony\":{\"description\":\"Enable/disable parsing of EcmaScript Modules syntax.\",\"type\":\"boolean\"},\"import\":{\"description\":\"Enable/disable parsing of import() syntax.\",\"type\":\"boolean\"},\"importExportsPresence\":{\"description\":\"Specifies the behavior of invalid export names in \\\"import ... from ...\\\".\",\"enum\":[\"error\",\"warn\",\"auto\",false]},\"node\":{\"$ref\":\"#/definitions/Node\"},\"reexportExportsPresence\":{\"description\":\"Specifies the behavior of invalid export names in \\\"export ... from ...\\\". This might be useful to disable during the migration from \\\"export ... from ...\\\" to \\\"export type ... from ...\\\" when reexporting types in TypeScript.\",\"enum\":[\"error\",\"warn\",\"auto\",false]},\"requireContext\":{\"description\":\"Enable/disable parsing of require.context syntax.\",\"type\":\"boolean\"},\"requireEnsure\":{\"description\":\"Enable/disable parsing of require.ensure syntax.\",\"type\":\"boolean\"},\"requireInclude\":{\"description\":\"Enable/disable parsing of require.include syntax.\",\"type\":\"boolean\"},\"requireJs\":{\"description\":\"Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.\",\"type\":\"boolean\"},\"strictExportPresence\":{\"description\":\"Deprecated in favor of \\\"exportsPresence\\\". Emit errors instead of warnings when imported names don't exist in imported module.\",\"type\":\"boolean\"},\"strictThisContextOnImports\":{\"description\":\"Handle the this context correctly according to the spec for namespace objects.\",\"type\":\"boolean\"},\"system\":{\"description\":\"Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.\",\"type\":\"boolean\"},\"unknownContextCritical\":{\"description\":\"Enable warnings when using the require function in a not statically analyse-able way.\",\"type\":\"boolean\"},\"unknownContextRecursive\":{\"description\":\"Enable recursive directory lookup when using the require function in a not statically analyse-able way.\",\"type\":\"boolean\"},\"unknownContextRegExp\":{\"description\":\"Sets the regular expression when using the require function in a not statically analyse-able way.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"boolean\"}]},\"unknownContextRequest\":{\"description\":\"Sets the request when using the require function in a not statically analyse-able way.\",\"type\":\"string\"},\"url\":{\"description\":\"Enable/disable parsing of new URL() syntax.\",\"anyOf\":[{\"enum\":[\"relative\"]},{\"type\":\"boolean\"}]},\"worker\":{\"description\":\"Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Specify a syntax that should be parsed as WebWorker reference. 'Abc' handles 'new Abc()', 'Abc from xyz' handles 'import { Abc } from \\\"xyz\\\"; new Abc()', 'abc()' handles 'abc()', and combinations are also possible.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"boolean\"}]},\"wrappedContextCritical\":{\"description\":\"Enable warnings for partial dynamic dependencies.\",\"type\":\"boolean\"},\"wrappedContextRecursive\":{\"description\":\"Enable recursive directory lookup for partial dynamic dependencies.\",\"type\":\"boolean\"},\"wrappedContextRegExp\":{\"description\":\"Set the inner regular expression for partial dynamic dependencies.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"}}},\"Layer\":{\"description\":\"Specifies the layer in which modules of this entrypoint are placed.\",\"anyOf\":[{\"enum\":[null]},{\"type\":\"string\",\"minLength\":1}]},\"LazyCompilationDefaultBackendOptions\":{\"description\":\"Options for the default backend.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"client\":{\"description\":\"A custom client.\",\"type\":\"string\"},\"listen\":{\"description\":\"Specifies where to listen to from the server.\",\"anyOf\":[{\"description\":\"A port.\",\"type\":\"number\"},{\"description\":\"Listen options.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"host\":{\"description\":\"A host.\",\"type\":\"string\"},\"port\":{\"description\":\"A port.\",\"type\":\"number\"}},\"tsType\":\"import(\\\"net\\\").ListenOptions\"},{\"description\":\"A custom listen function.\",\"instanceof\":\"Function\",\"tsType\":\"((server: import(\\\"net\\\").Server) => void)\"}]},\"protocol\":{\"description\":\"Specifies the protocol the client should use to connect to the server.\",\"enum\":[\"http\",\"https\"]},\"server\":{\"description\":\"Specifies how to create the server handling the EventSource requests.\",\"anyOf\":[{\"description\":\"ServerOptions for the http or https createServer call.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{},\"tsType\":\"(import(\\\"https\\\").ServerOptions | import(\\\"http\\\").ServerOptions)\"},{\"description\":\"A custom create server function.\",\"instanceof\":\"Function\",\"tsType\":\"(() => import(\\\"net\\\").Server)\"}]}}},\"LazyCompilationOptions\":{\"description\":\"Options for compiling entrypoints and import()s only when they are accessed.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"backend\":{\"description\":\"Specifies the backend that should be used for handling client keep alive.\",\"anyOf\":[{\"description\":\"A custom backend.\",\"instanceof\":\"Function\",\"tsType\":\"(((compiler: import('../lib/Compiler'), callback: (err?: Error, api?: import(\\\"../lib/hmr/LazyCompilationPlugin\\\").BackendApi) => void) => void) | ((compiler: import('../lib/Compiler')) => Promise))\"},{\"$ref\":\"#/definitions/LazyCompilationDefaultBackendOptions\"}]},\"entries\":{\"description\":\"Enable/disable lazy compilation for entries.\",\"type\":\"boolean\"},\"imports\":{\"description\":\"Enable/disable lazy compilation for import() modules.\",\"type\":\"boolean\"},\"test\":{\"description\":\"Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"((module: import('../lib/Module')) => boolean)\"}]}}},\"Library\":{\"description\":\"Make the output files a library, exporting the exports of the entry point.\",\"anyOf\":[{\"$ref\":\"#/definitions/LibraryName\"},{\"$ref\":\"#/definitions/LibraryOptions\"}]},\"LibraryCustomUmdCommentObject\":{\"description\":\"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Set comment for `amd` section in UMD.\",\"type\":\"string\"},\"commonjs\":{\"description\":\"Set comment for `commonjs` (exports) section in UMD.\",\"type\":\"string\"},\"commonjs2\":{\"description\":\"Set comment for `commonjs2` (module.exports) section in UMD.\",\"type\":\"string\"},\"root\":{\"description\":\"Set comment for `root` (global variable) section in UMD.\",\"type\":\"string\"}}},\"LibraryCustomUmdObject\":{\"description\":\"Description object for all UMD variants of the library name.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Name of the exposed AMD library in the UMD.\",\"type\":\"string\",\"minLength\":1},\"commonjs\":{\"description\":\"Name of the exposed commonjs export in the UMD.\",\"type\":\"string\",\"minLength\":1},\"root\":{\"description\":\"Name of the property exposed globally by a UMD library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the name of the property exposed globally by a UMD library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]}}},\"LibraryExport\":{\"description\":\"Specify which export should be exposed as library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the export that should be exposed as library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]},\"LibraryName\":{\"description\":\"The name of the library (some types allow unnamed libraries too).\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A part of the library name.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1},{\"type\":\"string\",\"minLength\":1},{\"$ref\":\"#/definitions/LibraryCustomUmdObject\"}]},\"LibraryOptions\":{\"description\":\"Options for library.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"auxiliaryComment\":{\"$ref\":\"#/definitions/AuxiliaryComment\"},\"export\":{\"$ref\":\"#/definitions/LibraryExport\"},\"name\":{\"$ref\":\"#/definitions/LibraryName\"},\"type\":{\"$ref\":\"#/definitions/LibraryType\"},\"umdNamedDefine\":{\"$ref\":\"#/definitions/UmdNamedDefine\"}},\"required\":[\"type\"]},\"LibraryType\":{\"description\":\"Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"var\",\"module\",\"assign\",\"assign-properties\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\"]},{\"type\":\"string\"}]},\"Loader\":{\"description\":\"Custom values available in the loader context.\",\"type\":\"object\"},\"MemoryCacheOptions\":{\"description\":\"Options object for in-memory caching.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"cacheUnaffected\":{\"description\":\"Additionally cache computation of modules that are unchanged and reference only unchanged modules.\",\"type\":\"boolean\"},\"maxGenerations\":{\"description\":\"Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).\",\"type\":\"number\",\"minimum\":1},\"type\":{\"description\":\"In memory caching.\",\"enum\":[\"memory\"]}},\"required\":[\"type\"]},\"Mode\":{\"description\":\"Enable production optimizations or development hints.\",\"enum\":[\"development\",\"production\",\"none\"]},\"ModuleFilterItemTypes\":{\"description\":\"Filtering value, regexp or function.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((name: string, module: import('../lib/stats/DefaultStatsFactoryPlugin').StatsModule, type: 'module' | 'chunk' | 'root-of-chunk' | 'nested') => boolean)\"}]},\"ModuleFilterTypes\":{\"description\":\"Filtering modules.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Rule to filter.\",\"cli\":{\"helper\":true},\"oneOf\":[{\"$ref\":\"#/definitions/ModuleFilterItemTypes\"}]}},{\"$ref\":\"#/definitions/ModuleFilterItemTypes\"}]},\"ModuleOptions\":{\"description\":\"Options affecting the normal modules (`NormalModuleFactory`).\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"defaultRules\":{\"description\":\"An array of rules applied by default for modules.\",\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRules\"}]},\"exprContextCritical\":{\"description\":\"Enable warnings for full dynamic dependencies.\",\"type\":\"boolean\"},\"exprContextRecursive\":{\"description\":\"Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.\",\"type\":\"boolean\"},\"exprContextRegExp\":{\"description\":\"Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"boolean\"}]},\"exprContextRequest\":{\"description\":\"Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.\",\"type\":\"string\"},\"generator\":{\"$ref\":\"#/definitions/GeneratorOptionsByModuleType\"},\"noParse\":{\"$ref\":\"#/definitions/NoParse\"},\"parser\":{\"$ref\":\"#/definitions/ParserOptionsByModuleType\"},\"rules\":{\"description\":\"An array of rules applied for modules.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRules\"}]},\"strictExportPresence\":{\"description\":\"Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.\",\"type\":\"boolean\"},\"strictThisContextOnImports\":{\"description\":\"Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.\",\"type\":\"boolean\"},\"unknownContextCritical\":{\"description\":\"Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.\",\"type\":\"boolean\"},\"unknownContextRecursive\":{\"description\":\"Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.\",\"type\":\"boolean\"},\"unknownContextRegExp\":{\"description\":\"Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"boolean\"}]},\"unknownContextRequest\":{\"description\":\"Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.\",\"type\":\"string\"},\"unsafeCache\":{\"description\":\"Cache the resolving of module requests.\",\"anyOf\":[{\"type\":\"boolean\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"wrappedContextCritical\":{\"description\":\"Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.\",\"type\":\"boolean\"},\"wrappedContextRecursive\":{\"description\":\"Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.\",\"type\":\"boolean\"},\"wrappedContextRegExp\":{\"description\":\"Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"}}},\"ModuleOptionsNormalized\":{\"description\":\"Options affecting the normal modules (`NormalModuleFactory`).\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"defaultRules\":{\"description\":\"An array of rules applied by default for modules.\",\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRules\"}]},\"generator\":{\"$ref\":\"#/definitions/GeneratorOptionsByModuleType\"},\"noParse\":{\"$ref\":\"#/definitions/NoParse\"},\"parser\":{\"$ref\":\"#/definitions/ParserOptionsByModuleType\"},\"rules\":{\"description\":\"An array of rules applied for modules.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRules\"}]},\"unsafeCache\":{\"description\":\"Cache the resolving of module requests.\",\"anyOf\":[{\"type\":\"boolean\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]}},\"required\":[\"defaultRules\",\"generator\",\"parser\",\"rules\"]},\"Name\":{\"description\":\"Name of the configuration. Used when loading multiple configurations.\",\"type\":\"string\"},\"NoParse\":{\"description\":\"Don't parse files matching. It's matched against the full resolved request.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Don't parse files matching. It's matched against the full resolved request.\",\"anyOf\":[{\"description\":\"A regular expression, when matched the module is not parsed.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"An absolute path, when the module starts with this path it is not parsed.\",\"type\":\"string\",\"absolutePath\":true},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"minItems\":1},{\"description\":\"A regular expression, when matched the module is not parsed.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"An absolute path, when the module starts with this path it is not parsed.\",\"type\":\"string\",\"absolutePath\":true},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"Node\":{\"description\":\"Include polyfills or mocks for various node stuff.\",\"anyOf\":[{\"enum\":[false]},{\"$ref\":\"#/definitions/NodeOptions\"}]},\"NodeOptions\":{\"description\":\"Options object for node compatibility features.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"__dirname\":{\"description\":\"Include a polyfill for the '__dirname' variable.\",\"enum\":[false,true,\"warn-mock\",\"mock\",\"eval-only\"]},\"__filename\":{\"description\":\"Include a polyfill for the '__filename' variable.\",\"enum\":[false,true,\"warn-mock\",\"mock\",\"eval-only\"]},\"global\":{\"description\":\"Include a polyfill for the 'global' variable.\",\"enum\":[false,true,\"warn\"]}}},\"Optimization\":{\"description\":\"Enables/Disables integrated optimizations.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"checkWasmTypes\":{\"description\":\"Check for incompatible wasm types when importing/exporting from/to ESM.\",\"type\":\"boolean\"},\"chunkIds\":{\"description\":\"Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).\",\"enum\":[\"natural\",\"named\",\"deterministic\",\"size\",\"total-size\",false]},\"concatenateModules\":{\"description\":\"Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.\",\"type\":\"boolean\"},\"emitOnErrors\":{\"description\":\"Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.\",\"type\":\"boolean\"},\"flagIncludedChunks\":{\"description\":\"Also flag chunks as loaded which contain a subset of the modules.\",\"type\":\"boolean\"},\"innerGraph\":{\"description\":\"Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.\",\"type\":\"boolean\"},\"mangleExports\":{\"description\":\"Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/\\\"deterministic\\\": generate short deterministic names optimized for caching, \\\"size\\\": generate the shortest possible names).\",\"anyOf\":[{\"enum\":[\"size\",\"deterministic\"]},{\"type\":\"boolean\"}]},\"mangleWasmImports\":{\"description\":\"Reduce size of WASM by changing imports to shorter strings.\",\"type\":\"boolean\"},\"mergeDuplicateChunks\":{\"description\":\"Merge chunks which contain the same modules.\",\"type\":\"boolean\"},\"minimize\":{\"description\":\"Enable minimizing the output. Uses optimization.minimizer.\",\"type\":\"boolean\"},\"minimizer\":{\"description\":\"Minimizer(s) to use for minimizing the output.\",\"type\":\"array\",\"cli\":{\"exclude\":true},\"items\":{\"description\":\"Plugin of type object or instanceof Function.\",\"anyOf\":[{\"enum\":[\"...\"]},{\"$ref\":\"#/definitions/WebpackPluginInstance\"},{\"$ref\":\"#/definitions/WebpackPluginFunction\"}]}},\"moduleIds\":{\"description\":\"Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).\",\"enum\":[\"natural\",\"named\",\"hashed\",\"deterministic\",\"size\",false]},\"noEmitOnErrors\":{\"description\":\"Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).\",\"type\":\"boolean\",\"cli\":{\"exclude\":true}},\"nodeEnv\":{\"description\":\"Set process.env.NODE_ENV to a specific value.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\"}]},\"portableRecords\":{\"description\":\"Generate records with relative paths to be able to move the context folder.\",\"type\":\"boolean\"},\"providedExports\":{\"description\":\"Figure out which exports are provided by modules to generate more efficient code.\",\"type\":\"boolean\"},\"realContentHash\":{\"description\":\"Use real [contenthash] based on final content of the assets.\",\"type\":\"boolean\"},\"removeAvailableModules\":{\"description\":\"Removes modules from chunks when these modules are already included in all parents.\",\"type\":\"boolean\"},\"removeEmptyChunks\":{\"description\":\"Remove chunks which are empty.\",\"type\":\"boolean\"},\"runtimeChunk\":{\"$ref\":\"#/definitions/OptimizationRuntimeChunk\"},\"sideEffects\":{\"description\":\"Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).\",\"anyOf\":[{\"enum\":[\"flag\"]},{\"type\":\"boolean\"}]},\"splitChunks\":{\"description\":\"Optimize duplication and caching by splitting chunks by shared modules and cache group.\",\"anyOf\":[{\"enum\":[false]},{\"$ref\":\"#/definitions/OptimizationSplitChunksOptions\"}]},\"usedExports\":{\"description\":\"Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, \\\"global\\\": analyse exports globally for all runtimes combined).\",\"anyOf\":[{\"enum\":[\"global\"]},{\"type\":\"boolean\"}]}}},\"OptimizationRuntimeChunk\":{\"description\":\"Create an additional chunk which contains only the webpack runtime and chunk hash maps.\",\"anyOf\":[{\"enum\":[\"single\",\"multiple\"]},{\"type\":\"boolean\"},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"description\":\"The name or name factory for the runtime chunks.\",\"anyOf\":[{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]}}}]},\"OptimizationRuntimeChunkNormalized\":{\"description\":\"Create an additional chunk which contains only the webpack runtime and chunk hash maps.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"description\":\"The name factory for the runtime chunks.\",\"instanceof\":\"Function\",\"tsType\":\"Function\"}}}]},\"OptimizationSplitChunksCacheGroup\":{\"description\":\"Options object for describing behavior of a cache group selecting modules that should be cached together.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"automaticNameDelimiter\":{\"description\":\"Sets the name delimiter for created chunks.\",\"type\":\"string\",\"minLength\":1},\"chunks\":{\"description\":\"Select chunks for determining cache group content (defaults to \\\"initial\\\", \\\"initial\\\" and \\\"all\\\" requires adding these chunks to the HTML).\",\"anyOf\":[{\"enum\":[\"initial\",\"async\",\"all\"]},{\"instanceof\":\"Function\",\"tsType\":\"((chunk: import('../lib/Chunk')) => boolean)\"}]},\"enforce\":{\"description\":\"Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.\",\"type\":\"boolean\"},\"enforceSizeThreshold\":{\"description\":\"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"filename\":{\"description\":\"Sets the template for the filename for created chunks.\",\"anyOf\":[{\"type\":\"string\",\"absolutePath\":false,\"minLength\":1},{\"instanceof\":\"Function\",\"tsType\":\"((pathData: import(\\\"../lib/Compilation\\\").PathData, assetInfo?: import(\\\"../lib/Compilation\\\").AssetInfo) => string)\"}]},\"idHint\":{\"description\":\"Sets the hint for chunk id.\",\"type\":\"string\"},\"layer\":{\"description\":\"Assign modules to a cache group by module layer.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"maxAsyncRequests\":{\"description\":\"Maximum number of requests which are accepted for on-demand loading.\",\"type\":\"number\",\"minimum\":1},\"maxAsyncSize\":{\"description\":\"Maximal size hint for the on-demand chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxInitialRequests\":{\"description\":\"Maximum number of initial chunks which are accepted for an entry point.\",\"type\":\"number\",\"minimum\":1},\"maxInitialSize\":{\"description\":\"Maximal size hint for the initial chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxSize\":{\"description\":\"Maximal size hint for the created chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minChunks\":{\"description\":\"Minimum number of times a module has to be duplicated until it's considered for splitting.\",\"type\":\"number\",\"minimum\":1},\"minRemainingSize\":{\"description\":\"Minimal size for the chunks the stay after moving the modules to a new chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSize\":{\"description\":\"Minimal size for the created chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSizeReduction\":{\"description\":\"Minimum size reduction due to the created chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"name\":{\"description\":\"Give chunks for this cache group a name (chunks with equal name are merged).\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"priority\":{\"description\":\"Priority of this cache group.\",\"type\":\"number\"},\"reuseExistingChunk\":{\"description\":\"Try to reuse existing chunk (with name) when it has matching modules.\",\"type\":\"boolean\"},\"test\":{\"description\":\"Assign modules to a cache group by module name.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"type\":{\"description\":\"Assign modules to a cache group by module type.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"usedExports\":{\"description\":\"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.\",\"type\":\"boolean\"}}},\"OptimizationSplitChunksGetCacheGroups\":{\"description\":\"A function returning cache groups.\",\"instanceof\":\"Function\",\"tsType\":\"((module: import('../lib/Module')) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void)\"},\"OptimizationSplitChunksOptions\":{\"description\":\"Options object for splitting chunks into smaller chunks.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"automaticNameDelimiter\":{\"description\":\"Sets the name delimiter for created chunks.\",\"type\":\"string\",\"minLength\":1},\"cacheGroups\":{\"description\":\"Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Configuration for a cache group.\",\"anyOf\":[{\"enum\":[false]},{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"},{\"$ref\":\"#/definitions/OptimizationSplitChunksCacheGroup\"}]},\"not\":{\"description\":\"Using the cacheGroup shorthand syntax with a cache group named 'test' is a potential config error\\nDid you intent to define a cache group with a test instead?\\ncacheGroups: {\\n : {\\n test: ...\\n }\\n}.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"test\":{\"description\":\"The test property is a cache group name, but using the test option of the cache group could be intended instead.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]}},\"required\":[\"test\"]}},\"chunks\":{\"description\":\"Select chunks for determining shared modules (defaults to \\\"async\\\", \\\"initial\\\" and \\\"all\\\" requires adding these chunks to the HTML).\",\"anyOf\":[{\"enum\":[\"initial\",\"async\",\"all\"]},{\"instanceof\":\"Function\",\"tsType\":\"((chunk: import('../lib/Chunk')) => boolean)\"}]},\"defaultSizeTypes\":{\"description\":\"Sets the size types which are used when a number is used for sizes.\",\"type\":\"array\",\"items\":{\"description\":\"Size type, like 'javascript', 'webassembly'.\",\"type\":\"string\"},\"minItems\":1},\"enforceSizeThreshold\":{\"description\":\"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"fallbackCacheGroup\":{\"description\":\"Options for modules not selected by any other cache group.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"automaticNameDelimiter\":{\"description\":\"Sets the name delimiter for created chunks.\",\"type\":\"string\",\"minLength\":1},\"chunks\":{\"description\":\"Select chunks for determining shared modules (defaults to \\\"async\\\", \\\"initial\\\" and \\\"all\\\" requires adding these chunks to the HTML).\",\"anyOf\":[{\"enum\":[\"initial\",\"async\",\"all\"]},{\"instanceof\":\"Function\",\"tsType\":\"((chunk: import('../lib/Chunk')) => boolean)\"}]},\"maxAsyncSize\":{\"description\":\"Maximal size hint for the on-demand chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxInitialSize\":{\"description\":\"Maximal size hint for the initial chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxSize\":{\"description\":\"Maximal size hint for the created chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSize\":{\"description\":\"Minimal size for the created chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSizeReduction\":{\"description\":\"Minimum size reduction due to the created chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]}}},\"filename\":{\"description\":\"Sets the template for the filename for created chunks.\",\"anyOf\":[{\"type\":\"string\",\"absolutePath\":false,\"minLength\":1},{\"instanceof\":\"Function\",\"tsType\":\"((pathData: import(\\\"../lib/Compilation\\\").PathData, assetInfo?: import(\\\"../lib/Compilation\\\").AssetInfo) => string)\"}]},\"hidePathInfo\":{\"description\":\"Prevents exposing path info when creating names for parts splitted by maxSize.\",\"type\":\"boolean\"},\"maxAsyncRequests\":{\"description\":\"Maximum number of requests which are accepted for on-demand loading.\",\"type\":\"number\",\"minimum\":1},\"maxAsyncSize\":{\"description\":\"Maximal size hint for the on-demand chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxInitialRequests\":{\"description\":\"Maximum number of initial chunks which are accepted for an entry point.\",\"type\":\"number\",\"minimum\":1},\"maxInitialSize\":{\"description\":\"Maximal size hint for the initial chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"maxSize\":{\"description\":\"Maximal size hint for the created chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minChunks\":{\"description\":\"Minimum number of times a module has to be duplicated until it's considered for splitting.\",\"type\":\"number\",\"minimum\":1},\"minRemainingSize\":{\"description\":\"Minimal size for the chunks the stay after moving the modules to a new chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSize\":{\"description\":\"Minimal size for the created chunks.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"minSizeReduction\":{\"description\":\"Minimum size reduction due to the created chunk.\",\"oneOf\":[{\"$ref\":\"#/definitions/OptimizationSplitChunksSizes\"}]},\"name\":{\"description\":\"Give chunks created a name (chunks with equal name are merged).\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"usedExports\":{\"description\":\"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.\",\"type\":\"boolean\"}}},\"OptimizationSplitChunksSizes\":{\"description\":\"Size description for limits.\",\"anyOf\":[{\"description\":\"Size of the javascript part of the chunk.\",\"type\":\"number\",\"minimum\":0},{\"description\":\"Specify size limits per size type.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Size of the part of the chunk with the type of the key.\",\"type\":\"number\"}}]},\"Output\":{\"description\":\"Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"assetModuleFilename\":{\"$ref\":\"#/definitions/AssetModuleFilename\"},\"asyncChunks\":{\"description\":\"Enable/disable creating async chunks that are loaded on demand.\",\"type\":\"boolean\"},\"auxiliaryComment\":{\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/AuxiliaryComment\"}]},\"charset\":{\"$ref\":\"#/definitions/Charset\"},\"chunkFilename\":{\"$ref\":\"#/definitions/ChunkFilename\"},\"chunkFormat\":{\"$ref\":\"#/definitions/ChunkFormat\"},\"chunkLoadTimeout\":{\"$ref\":\"#/definitions/ChunkLoadTimeout\"},\"chunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"chunkLoadingGlobal\":{\"$ref\":\"#/definitions/ChunkLoadingGlobal\"},\"clean\":{\"$ref\":\"#/definitions/Clean\"},\"compareBeforeEmit\":{\"$ref\":\"#/definitions/CompareBeforeEmit\"},\"crossOriginLoading\":{\"$ref\":\"#/definitions/CrossOriginLoading\"},\"devtoolFallbackModuleFilenameTemplate\":{\"$ref\":\"#/definitions/DevtoolFallbackModuleFilenameTemplate\"},\"devtoolModuleFilenameTemplate\":{\"$ref\":\"#/definitions/DevtoolModuleFilenameTemplate\"},\"devtoolNamespace\":{\"$ref\":\"#/definitions/DevtoolNamespace\"},\"enabledChunkLoadingTypes\":{\"$ref\":\"#/definitions/EnabledChunkLoadingTypes\"},\"enabledLibraryTypes\":{\"$ref\":\"#/definitions/EnabledLibraryTypes\"},\"enabledWasmLoadingTypes\":{\"$ref\":\"#/definitions/EnabledWasmLoadingTypes\"},\"environment\":{\"$ref\":\"#/definitions/Environment\"},\"filename\":{\"$ref\":\"#/definitions/Filename\"},\"globalObject\":{\"$ref\":\"#/definitions/GlobalObject\"},\"hashDigest\":{\"$ref\":\"#/definitions/HashDigest\"},\"hashDigestLength\":{\"$ref\":\"#/definitions/HashDigestLength\"},\"hashFunction\":{\"$ref\":\"#/definitions/HashFunction\"},\"hashSalt\":{\"$ref\":\"#/definitions/HashSalt\"},\"hotUpdateChunkFilename\":{\"$ref\":\"#/definitions/HotUpdateChunkFilename\"},\"hotUpdateGlobal\":{\"$ref\":\"#/definitions/HotUpdateGlobal\"},\"hotUpdateMainFilename\":{\"$ref\":\"#/definitions/HotUpdateMainFilename\"},\"iife\":{\"$ref\":\"#/definitions/Iife\"},\"importFunctionName\":{\"$ref\":\"#/definitions/ImportFunctionName\"},\"importMetaName\":{\"$ref\":\"#/definitions/ImportMetaName\"},\"library\":{\"$ref\":\"#/definitions/Library\"},\"libraryExport\":{\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/LibraryExport\"}]},\"libraryTarget\":{\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/LibraryType\"}]},\"module\":{\"$ref\":\"#/definitions/OutputModule\"},\"path\":{\"$ref\":\"#/definitions/Path\"},\"pathinfo\":{\"$ref\":\"#/definitions/Pathinfo\"},\"publicPath\":{\"$ref\":\"#/definitions/PublicPath\"},\"scriptType\":{\"$ref\":\"#/definitions/ScriptType\"},\"sourceMapFilename\":{\"$ref\":\"#/definitions/SourceMapFilename\"},\"sourcePrefix\":{\"$ref\":\"#/definitions/SourcePrefix\"},\"strictModuleErrorHandling\":{\"$ref\":\"#/definitions/StrictModuleErrorHandling\"},\"strictModuleExceptionHandling\":{\"$ref\":\"#/definitions/StrictModuleExceptionHandling\"},\"trustedTypes\":{\"description\":\"Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.\",\"anyOf\":[{\"enum\":[true]},{\"description\":\"The name of the Trusted Types policy created by webpack to serve bundle chunks.\",\"type\":\"string\",\"minLength\":1},{\"$ref\":\"#/definitions/TrustedTypes\"}]},\"umdNamedDefine\":{\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/UmdNamedDefine\"}]},\"uniqueName\":{\"$ref\":\"#/definitions/UniqueName\"},\"wasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"},\"webassemblyModuleFilename\":{\"$ref\":\"#/definitions/WebassemblyModuleFilename\"},\"workerChunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"workerWasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"}}},\"OutputModule\":{\"description\":\"Output javascript files as module source type.\",\"type\":\"boolean\"},\"OutputNormalized\":{\"description\":\"Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"assetModuleFilename\":{\"$ref\":\"#/definitions/AssetModuleFilename\"},\"asyncChunks\":{\"description\":\"Enable/disable creating async chunks that are loaded on demand.\",\"type\":\"boolean\"},\"charset\":{\"$ref\":\"#/definitions/Charset\"},\"chunkFilename\":{\"$ref\":\"#/definitions/ChunkFilename\"},\"chunkFormat\":{\"$ref\":\"#/definitions/ChunkFormat\"},\"chunkLoadTimeout\":{\"$ref\":\"#/definitions/ChunkLoadTimeout\"},\"chunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"chunkLoadingGlobal\":{\"$ref\":\"#/definitions/ChunkLoadingGlobal\"},\"clean\":{\"$ref\":\"#/definitions/Clean\"},\"compareBeforeEmit\":{\"$ref\":\"#/definitions/CompareBeforeEmit\"},\"crossOriginLoading\":{\"$ref\":\"#/definitions/CrossOriginLoading\"},\"devtoolFallbackModuleFilenameTemplate\":{\"$ref\":\"#/definitions/DevtoolFallbackModuleFilenameTemplate\"},\"devtoolModuleFilenameTemplate\":{\"$ref\":\"#/definitions/DevtoolModuleFilenameTemplate\"},\"devtoolNamespace\":{\"$ref\":\"#/definitions/DevtoolNamespace\"},\"enabledChunkLoadingTypes\":{\"$ref\":\"#/definitions/EnabledChunkLoadingTypes\"},\"enabledLibraryTypes\":{\"$ref\":\"#/definitions/EnabledLibraryTypes\"},\"enabledWasmLoadingTypes\":{\"$ref\":\"#/definitions/EnabledWasmLoadingTypes\"},\"environment\":{\"$ref\":\"#/definitions/Environment\"},\"filename\":{\"$ref\":\"#/definitions/Filename\"},\"globalObject\":{\"$ref\":\"#/definitions/GlobalObject\"},\"hashDigest\":{\"$ref\":\"#/definitions/HashDigest\"},\"hashDigestLength\":{\"$ref\":\"#/definitions/HashDigestLength\"},\"hashFunction\":{\"$ref\":\"#/definitions/HashFunction\"},\"hashSalt\":{\"$ref\":\"#/definitions/HashSalt\"},\"hotUpdateChunkFilename\":{\"$ref\":\"#/definitions/HotUpdateChunkFilename\"},\"hotUpdateGlobal\":{\"$ref\":\"#/definitions/HotUpdateGlobal\"},\"hotUpdateMainFilename\":{\"$ref\":\"#/definitions/HotUpdateMainFilename\"},\"iife\":{\"$ref\":\"#/definitions/Iife\"},\"importFunctionName\":{\"$ref\":\"#/definitions/ImportFunctionName\"},\"importMetaName\":{\"$ref\":\"#/definitions/ImportMetaName\"},\"library\":{\"$ref\":\"#/definitions/LibraryOptions\"},\"module\":{\"$ref\":\"#/definitions/OutputModule\"},\"path\":{\"$ref\":\"#/definitions/Path\"},\"pathinfo\":{\"$ref\":\"#/definitions/Pathinfo\"},\"publicPath\":{\"$ref\":\"#/definitions/PublicPath\"},\"scriptType\":{\"$ref\":\"#/definitions/ScriptType\"},\"sourceMapFilename\":{\"$ref\":\"#/definitions/SourceMapFilename\"},\"sourcePrefix\":{\"$ref\":\"#/definitions/SourcePrefix\"},\"strictModuleErrorHandling\":{\"$ref\":\"#/definitions/StrictModuleErrorHandling\"},\"strictModuleExceptionHandling\":{\"$ref\":\"#/definitions/StrictModuleExceptionHandling\"},\"trustedTypes\":{\"$ref\":\"#/definitions/TrustedTypes\"},\"uniqueName\":{\"$ref\":\"#/definitions/UniqueName\"},\"wasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"},\"webassemblyModuleFilename\":{\"$ref\":\"#/definitions/WebassemblyModuleFilename\"},\"workerChunkLoading\":{\"$ref\":\"#/definitions/ChunkLoading\"},\"workerWasmLoading\":{\"$ref\":\"#/definitions/WasmLoading\"}}},\"Parallelism\":{\"description\":\"The number of parallel processed modules in the compilation.\",\"type\":\"number\",\"minimum\":1},\"ParserOptionsByModuleType\":{\"description\":\"Specify options for each parser.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Options for parsing.\",\"type\":\"object\",\"additionalProperties\":true},\"properties\":{\"asset\":{\"$ref\":\"#/definitions/AssetParserOptions\"},\"asset/inline\":{\"$ref\":\"#/definitions/EmptyParserOptions\"},\"asset/resource\":{\"$ref\":\"#/definitions/EmptyParserOptions\"},\"asset/source\":{\"$ref\":\"#/definitions/EmptyParserOptions\"},\"javascript\":{\"$ref\":\"#/definitions/JavascriptParserOptions\"},\"javascript/auto\":{\"$ref\":\"#/definitions/JavascriptParserOptions\"},\"javascript/dynamic\":{\"$ref\":\"#/definitions/JavascriptParserOptions\"},\"javascript/esm\":{\"$ref\":\"#/definitions/JavascriptParserOptions\"}}},\"Path\":{\"description\":\"The output directory as **absolute path** (required).\",\"type\":\"string\",\"absolutePath\":true},\"Pathinfo\":{\"description\":\"Include comments with information about the modules.\",\"anyOf\":[{\"enum\":[\"verbose\"]},{\"type\":\"boolean\"}]},\"Performance\":{\"description\":\"Configuration for web performance recommendations.\",\"anyOf\":[{\"enum\":[false]},{\"$ref\":\"#/definitions/PerformanceOptions\"}]},\"PerformanceOptions\":{\"description\":\"Configuration object for web performance recommendations.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"assetFilter\":{\"description\":\"Filter function to select assets that are checked.\",\"instanceof\":\"Function\",\"tsType\":\"Function\"},\"hints\":{\"description\":\"Sets the format of the hints: warnings, errors or nothing at all.\",\"enum\":[false,\"warning\",\"error\"]},\"maxAssetSize\":{\"description\":\"File size limit (in bytes) when exceeded, that webpack will provide performance hints.\",\"type\":\"number\"},\"maxEntrypointSize\":{\"description\":\"Total size of an entry point (in bytes).\",\"type\":\"number\"}}},\"Plugins\":{\"description\":\"Add additional plugins to the compiler.\",\"type\":\"array\",\"items\":{\"description\":\"Plugin of type object or instanceof Function.\",\"anyOf\":[{\"$ref\":\"#/definitions/WebpackPluginInstance\"},{\"$ref\":\"#/definitions/WebpackPluginFunction\"}]}},\"Profile\":{\"description\":\"Capture timing information for each module.\",\"type\":\"boolean\"},\"PublicPath\":{\"description\":\"The 'publicPath' specifies the public URL address of the output files when referenced in a browser.\",\"anyOf\":[{\"enum\":[\"auto\"]},{\"$ref\":\"#/definitions/RawPublicPath\"}]},\"RawPublicPath\":{\"description\":\"The 'publicPath' specifies the public URL address of the output files when referenced in a browser.\",\"anyOf\":[{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"((pathData: import(\\\"../lib/Compilation\\\").PathData, assetInfo?: import(\\\"../lib/Compilation\\\").AssetInfo) => string)\"}]},\"RecordsInputPath\":{\"description\":\"Store compiler state to a json file.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"absolutePath\":true}]},\"RecordsOutputPath\":{\"description\":\"Load compiler state from a json file.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"absolutePath\":true}]},\"RecordsPath\":{\"description\":\"Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"absolutePath\":true}]},\"Resolve\":{\"description\":\"Options for the resolver.\",\"oneOf\":[{\"$ref\":\"#/definitions/ResolveOptions\"}]},\"ResolveAlias\":{\"description\":\"Redirect module requests.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Alias configuration.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"alias\":{\"description\":\"New request.\",\"anyOf\":[{\"description\":\"Multiple alternative requests.\",\"type\":\"array\",\"items\":{\"description\":\"One choice of request.\",\"type\":\"string\",\"minLength\":1}},{\"description\":\"Ignore request (replace with empty module).\",\"enum\":[false]},{\"description\":\"New request.\",\"type\":\"string\",\"minLength\":1}]},\"name\":{\"description\":\"Request to be redirected.\",\"type\":\"string\"},\"onlyModule\":{\"description\":\"Redirect only exact matching request.\",\"type\":\"boolean\"}},\"required\":[\"alias\",\"name\"]}},{\"type\":\"object\",\"additionalProperties\":{\"description\":\"New request.\",\"anyOf\":[{\"description\":\"Multiple alternative requests.\",\"type\":\"array\",\"items\":{\"description\":\"One choice of request.\",\"type\":\"string\",\"minLength\":1}},{\"description\":\"Ignore request (replace with empty module).\",\"enum\":[false]},{\"description\":\"New request.\",\"type\":\"string\",\"minLength\":1}]}}]},\"ResolveLoader\":{\"description\":\"Options for the resolver when resolving loaders.\",\"oneOf\":[{\"$ref\":\"#/definitions/ResolveOptions\"}]},\"ResolveOptions\":{\"description\":\"Options object for resolving requests.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"alias\":{\"$ref\":\"#/definitions/ResolveAlias\"},\"aliasFields\":{\"description\":\"Fields in the description file (usually package.json) which are used to redirect requests inside the module.\",\"type\":\"array\",\"items\":{\"description\":\"Field in the description file (usually package.json) which are used to redirect requests inside the module.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the field path in the description file (usually package.json) which are used to redirect requests inside the module.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]}},\"byDependency\":{\"description\":\"Extra resolve options per dependency category. Typical categories are \\\"commonjs\\\", \\\"amd\\\", \\\"esm\\\".\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Options object for resolving requests.\",\"oneOf\":[{\"$ref\":\"#/definitions/ResolveOptions\"}]}},\"cache\":{\"description\":\"Enable caching of successfully resolved requests (cache entries are revalidated).\",\"type\":\"boolean\"},\"cachePredicate\":{\"description\":\"Predicate function to decide which requests should be cached.\",\"instanceof\":\"Function\",\"tsType\":\"((request: import('enhanced-resolve').ResolveRequest) => boolean)\"},\"cacheWithContext\":{\"description\":\"Include the context information in the cache identifier when caching.\",\"type\":\"boolean\"},\"conditionNames\":{\"description\":\"Condition names for exports field entry point.\",\"type\":\"array\",\"items\":{\"description\":\"Condition names for exports field entry point.\",\"type\":\"string\"}},\"descriptionFiles\":{\"description\":\"Filenames used to find a description file (like a package.json).\",\"type\":\"array\",\"items\":{\"description\":\"Filename used to find a description file (like a package.json).\",\"type\":\"string\",\"minLength\":1}},\"enforceExtension\":{\"description\":\"Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).\",\"type\":\"boolean\"},\"exportsFields\":{\"description\":\"Field names from the description file (usually package.json) which are used to provide entry points of a package.\",\"type\":\"array\",\"items\":{\"description\":\"Field name from the description file (usually package.json) which is used to provide entry points of a package.\",\"type\":\"string\"}},\"extensions\":{\"description\":\"Extensions added to the request when trying to find the file.\",\"type\":\"array\",\"items\":{\"description\":\"Extension added to the request when trying to find the file.\",\"type\":\"string\"}},\"fallback\":{\"description\":\"Redirect module requests when normal resolving fails.\",\"oneOf\":[{\"$ref\":\"#/definitions/ResolveAlias\"}]},\"fileSystem\":{\"description\":\"Filesystem for the resolver.\",\"tsType\":\"(import('../lib/util/fs').InputFileSystem)\"},\"fullySpecified\":{\"description\":\"Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).\",\"type\":\"boolean\"},\"importsFields\":{\"description\":\"Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).\",\"type\":\"array\",\"items\":{\"description\":\"Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).\",\"type\":\"string\"}},\"mainFields\":{\"description\":\"Field names from the description file (package.json) which are used to find the default entry point.\",\"type\":\"array\",\"items\":{\"description\":\"Field name from the description file (package.json) which are used to find the default entry point.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the field path from the description file (package.json) which are used to find the default entry point.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]}},\"mainFiles\":{\"description\":\"Filenames used to find the default entry point if there is no description file or main field.\",\"type\":\"array\",\"items\":{\"description\":\"Filename used to find the default entry point if there is no description file or main field.\",\"type\":\"string\",\"minLength\":1}},\"modules\":{\"description\":\"Folder names or directory paths where to find modules.\",\"type\":\"array\",\"items\":{\"description\":\"Folder name or directory path where to find modules.\",\"type\":\"string\",\"minLength\":1}},\"plugins\":{\"description\":\"Plugins for the resolver.\",\"type\":\"array\",\"cli\":{\"exclude\":true},\"items\":{\"description\":\"Plugin of type object or instanceof Function.\",\"anyOf\":[{\"enum\":[\"...\"]},{\"$ref\":\"#/definitions/ResolvePluginInstance\"}]}},\"preferAbsolute\":{\"description\":\"Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.\",\"type\":\"boolean\"},\"preferRelative\":{\"description\":\"Prefer to resolve module requests as relative request and fallback to resolving as module.\",\"type\":\"boolean\"},\"resolver\":{\"description\":\"Custom resolver.\",\"tsType\":\"(import('enhanced-resolve').Resolver)\"},\"restrictions\":{\"description\":\"A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.\",\"type\":\"array\",\"items\":{\"description\":\"Resolve restriction. Resolve result must fulfill this restriction.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":true,\"minLength\":1}]}},\"roots\":{\"description\":\"A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.\",\"type\":\"array\",\"items\":{\"description\":\"Directory in which requests that are server-relative URLs (starting with '/') are resolved.\",\"type\":\"string\"}},\"symlinks\":{\"description\":\"Enable resolving symlinks to the original location.\",\"type\":\"boolean\"},\"unsafeCache\":{\"description\":\"Enable caching of successfully resolved requests (cache entries are not revalidated).\",\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"useSyncFileSystemCalls\":{\"description\":\"Use synchronous filesystem calls for the resolver.\",\"type\":\"boolean\"}}},\"ResolvePluginInstance\":{\"description\":\"Plugin instance.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"apply\":{\"description\":\"The run point of the plugin, required method.\",\"instanceof\":\"Function\",\"tsType\":\"(resolver: import('enhanced-resolve').Resolver) => void\"}},\"required\":[\"apply\"]},\"RuleSetCondition\":{\"description\":\"A condition matcher.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"},{\"instanceof\":\"Function\",\"tsType\":\"((value: string) => boolean)\"},{\"$ref\":\"#/definitions/RuleSetLogicalConditions\"},{\"$ref\":\"#/definitions/RuleSetConditions\"}]},\"RuleSetConditionAbsolute\":{\"description\":\"A condition matcher matching an absolute path.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":true},{\"instanceof\":\"Function\",\"tsType\":\"((value: string) => boolean)\"},{\"$ref\":\"#/definitions/RuleSetLogicalConditionsAbsolute\"},{\"$ref\":\"#/definitions/RuleSetConditionsAbsolute\"}]},\"RuleSetConditionOrConditions\":{\"description\":\"One or multiple rule conditions.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"$ref\":\"#/definitions/RuleSetCondition\"},{\"$ref\":\"#/definitions/RuleSetConditions\"}]},\"RuleSetConditionOrConditionsAbsolute\":{\"description\":\"One or multiple rule conditions matching an absolute path.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"$ref\":\"#/definitions/RuleSetConditionAbsolute\"},{\"$ref\":\"#/definitions/RuleSetConditionsAbsolute\"}]},\"RuleSetConditions\":{\"description\":\"A list of rule conditions.\",\"type\":\"array\",\"items\":{\"description\":\"A rule condition.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetCondition\"}]}},\"RuleSetConditionsAbsolute\":{\"description\":\"A list of rule conditions matching an absolute path.\",\"type\":\"array\",\"items\":{\"description\":\"A rule condition matching an absolute path.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionAbsolute\"}]}},\"RuleSetLoader\":{\"description\":\"A loader request.\",\"type\":\"string\",\"minLength\":1},\"RuleSetLoaderOptions\":{\"description\":\"Options passed to a loader.\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\"}]},\"RuleSetLogicalConditions\":{\"description\":\"Logic operators used in a condition matcher.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"and\":{\"description\":\"Logical AND.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditions\"}]},\"not\":{\"description\":\"Logical NOT.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetCondition\"}]},\"or\":{\"description\":\"Logical OR.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditions\"}]}}},\"RuleSetLogicalConditionsAbsolute\":{\"description\":\"Logic operators used in a condition matcher.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"and\":{\"description\":\"Logical AND.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionsAbsolute\"}]},\"not\":{\"description\":\"Logical NOT.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionAbsolute\"}]},\"or\":{\"description\":\"Logical OR.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionsAbsolute\"}]}}},\"RuleSetRule\":{\"description\":\"A rule description with conditions and effects for modules.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"assert\":{\"description\":\"Match on import assertions of the dependency.\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}},\"compiler\":{\"description\":\"Match the child compiler name.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"dependency\":{\"description\":\"Match dependency type.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"descriptionData\":{\"description\":\"Match values of properties in the description file (usually package.json).\",\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}},\"enforce\":{\"description\":\"Enforce this rule as pre or post step.\",\"enum\":[\"pre\",\"post\"]},\"exclude\":{\"description\":\"Shortcut for resource.exclude.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"generator\":{\"description\":\"The options for the module generator.\",\"type\":\"object\"},\"include\":{\"description\":\"Shortcut for resource.include.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"issuer\":{\"description\":\"Match the issuer of the module (The module pointing to this module).\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"issuerLayer\":{\"description\":\"Match layer of the issuer of this module (The module pointing to this module).\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"layer\":{\"description\":\"Specifies the layer in which the module should be placed in.\",\"type\":\"string\"},\"loader\":{\"description\":\"Shortcut for use.loader.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetLoader\"}]},\"mimetype\":{\"description\":\"Match module mimetype when load from Data URI.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"oneOf\":{\"description\":\"Only execute the first matching rule in this array.\",\"type\":\"array\",\"items\":{\"description\":\"A rule.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRule\"}]}},\"options\":{\"description\":\"Shortcut for use.options.\",\"cli\":{\"exclude\":true},\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetLoaderOptions\"}]},\"parser\":{\"description\":\"Options for parsing.\",\"type\":\"object\",\"additionalProperties\":true},\"realResource\":{\"description\":\"Match the real resource path of the module.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"resolve\":{\"description\":\"Options for the resolver.\",\"type\":\"object\",\"oneOf\":[{\"$ref\":\"#/definitions/ResolveOptions\"}]},\"resource\":{\"description\":\"Match the resource path of the module.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"resourceFragment\":{\"description\":\"Match the resource fragment of the module.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"resourceQuery\":{\"description\":\"Match the resource query of the module.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"rules\":{\"description\":\"Match and execute these rules when this rule is matched.\",\"type\":\"array\",\"items\":{\"description\":\"A rule.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetRule\"}]}},\"scheme\":{\"description\":\"Match module scheme.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditions\"}]},\"sideEffects\":{\"description\":\"Flags a module as with or without side effects.\",\"type\":\"boolean\"},\"test\":{\"description\":\"Shortcut for resource.test.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetConditionOrConditionsAbsolute\"}]},\"type\":{\"description\":\"Module type to use for the module.\",\"type\":\"string\"},\"use\":{\"description\":\"Modifiers applied to the module when rule is matched.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetUse\"}]}}},\"RuleSetRules\":{\"description\":\"A list of rules.\",\"type\":\"array\",\"items\":{\"description\":\"A rule.\",\"anyOf\":[{\"cli\":{\"exclude\":true},\"enum\":[\"...\"]},{\"$ref\":\"#/definitions/RuleSetRule\"}]}},\"RuleSetUse\":{\"description\":\"A list of descriptions of loaders applied.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"An use item.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetUseItem\"}]}},{\"instanceof\":\"Function\",\"tsType\":\"((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])\"},{\"$ref\":\"#/definitions/RuleSetUseItem\"}]},\"RuleSetUseItem\":{\"description\":\"A description of an applied loader.\",\"anyOf\":[{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"ident\":{\"description\":\"Unique loader options identifier.\",\"type\":\"string\"},\"loader\":{\"description\":\"Loader name.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetLoader\"}]},\"options\":{\"description\":\"Loader options.\",\"oneOf\":[{\"$ref\":\"#/definitions/RuleSetLoaderOptions\"}]}}},{\"instanceof\":\"Function\",\"tsType\":\"((data: object) => RuleSetUseItem|RuleSetUseItem[])\"},{\"$ref\":\"#/definitions/RuleSetLoader\"}]},\"ScriptType\":{\"description\":\"This option enables loading async chunks via a custom script type, such as script type=\\\"module\\\".\",\"enum\":[false,\"text/javascript\",\"module\"]},\"SnapshotOptions\":{\"description\":\"Options affecting how file system snapshots are created and validated.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"buildDependencies\":{\"description\":\"Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"hash\":{\"description\":\"Use hashes of the content of the files/directories to determine invalidation.\",\"type\":\"boolean\"},\"timestamp\":{\"description\":\"Use timestamps of the files/directories to determine invalidation.\",\"type\":\"boolean\"}}},\"immutablePaths\":{\"description\":\"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.\",\"type\":\"array\",\"items\":{\"description\":\"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.\",\"anyOf\":[{\"description\":\"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"A path to an immutable directory (usually a package manager cache directory).\",\"type\":\"string\",\"absolutePath\":true,\"minLength\":1}]}},\"managedPaths\":{\"description\":\"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.\",\"type\":\"array\",\"items\":{\"description\":\"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.\",\"anyOf\":[{\"description\":\"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"A path to a managed directory (usually a node_modules directory).\",\"type\":\"string\",\"absolutePath\":true,\"minLength\":1}]}},\"module\":{\"description\":\"Options for snapshotting dependencies of modules to determine if they need to be built again.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"hash\":{\"description\":\"Use hashes of the content of the files/directories to determine invalidation.\",\"type\":\"boolean\"},\"timestamp\":{\"description\":\"Use timestamps of the files/directories to determine invalidation.\",\"type\":\"boolean\"}}},\"resolve\":{\"description\":\"Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"hash\":{\"description\":\"Use hashes of the content of the files/directories to determine invalidation.\",\"type\":\"boolean\"},\"timestamp\":{\"description\":\"Use timestamps of the files/directories to determine invalidation.\",\"type\":\"boolean\"}}},\"resolveBuildDependencies\":{\"description\":\"Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"hash\":{\"description\":\"Use hashes of the content of the files/directories to determine invalidation.\",\"type\":\"boolean\"},\"timestamp\":{\"description\":\"Use timestamps of the files/directories to determine invalidation.\",\"type\":\"boolean\"}}}}},\"SourceMapFilename\":{\"description\":\"The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.\",\"type\":\"string\",\"absolutePath\":false},\"SourcePrefix\":{\"description\":\"Prefixes every line of the source in the bundle with this string.\",\"type\":\"string\"},\"StatsOptions\":{\"description\":\"Stats options object.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"all\":{\"description\":\"Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).\",\"type\":\"boolean\"},\"assets\":{\"description\":\"Add assets information.\",\"type\":\"boolean\"},\"assetsSort\":{\"description\":\"Sort the assets by that field.\",\"type\":\"string\"},\"assetsSpace\":{\"description\":\"Space to display assets (groups will be collapsed to fit this space).\",\"type\":\"number\"},\"builtAt\":{\"description\":\"Add built at time information.\",\"type\":\"boolean\"},\"cached\":{\"description\":\"Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).\",\"type\":\"boolean\"},\"cachedAssets\":{\"description\":\"Show cached assets (setting this to `false` only shows emitted files).\",\"type\":\"boolean\"},\"cachedModules\":{\"description\":\"Add information about cached (not built) modules.\",\"type\":\"boolean\"},\"children\":{\"description\":\"Add children information.\",\"type\":\"boolean\"},\"chunkGroupAuxiliary\":{\"description\":\"Display auxiliary assets in chunk groups.\",\"type\":\"boolean\"},\"chunkGroupChildren\":{\"description\":\"Display children of chunk groups.\",\"type\":\"boolean\"},\"chunkGroupMaxAssets\":{\"description\":\"Limit of assets displayed in chunk groups.\",\"type\":\"number\"},\"chunkGroups\":{\"description\":\"Display all chunk groups with the corresponding bundles.\",\"type\":\"boolean\"},\"chunkModules\":{\"description\":\"Add built modules information to chunk information.\",\"type\":\"boolean\"},\"chunkModulesSpace\":{\"description\":\"Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).\",\"type\":\"number\"},\"chunkOrigins\":{\"description\":\"Add the origins of chunks and chunk merging info.\",\"type\":\"boolean\"},\"chunkRelations\":{\"description\":\"Add information about parent, children and sibling chunks to chunk information.\",\"type\":\"boolean\"},\"chunks\":{\"description\":\"Add chunk information.\",\"type\":\"boolean\"},\"chunksSort\":{\"description\":\"Sort the chunks by that field.\",\"type\":\"string\"},\"colors\":{\"description\":\"Enables/Disables colorful output.\",\"anyOf\":[{\"description\":\"Enables/Disables colorful output.\",\"type\":\"boolean\"},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"bold\":{\"description\":\"Custom color for bold text.\",\"type\":\"string\"},\"cyan\":{\"description\":\"Custom color for cyan text.\",\"type\":\"string\"},\"green\":{\"description\":\"Custom color for green text.\",\"type\":\"string\"},\"magenta\":{\"description\":\"Custom color for magenta text.\",\"type\":\"string\"},\"red\":{\"description\":\"Custom color for red text.\",\"type\":\"string\"},\"yellow\":{\"description\":\"Custom color for yellow text.\",\"type\":\"string\"}}}]},\"context\":{\"description\":\"Context directory for request shortening.\",\"type\":\"string\",\"absolutePath\":true},\"dependentModules\":{\"description\":\"Show chunk modules that are dependencies of other modules of the chunk.\",\"type\":\"boolean\"},\"depth\":{\"description\":\"Add module depth in module graph.\",\"type\":\"boolean\"},\"entrypoints\":{\"description\":\"Display the entry points with the corresponding bundles.\",\"anyOf\":[{\"enum\":[\"auto\"]},{\"type\":\"boolean\"}]},\"env\":{\"description\":\"Add --env information.\",\"type\":\"boolean\"},\"errorDetails\":{\"description\":\"Add details to errors (like resolving log).\",\"anyOf\":[{\"enum\":[\"auto\"]},{\"type\":\"boolean\"}]},\"errorStack\":{\"description\":\"Add internal stack trace to errors.\",\"type\":\"boolean\"},\"errors\":{\"description\":\"Add errors.\",\"type\":\"boolean\"},\"errorsCount\":{\"description\":\"Add errors count.\",\"type\":\"boolean\"},\"exclude\":{\"description\":\"Please use excludeModules instead.\",\"cli\":{\"exclude\":true},\"anyOf\":[{\"type\":\"boolean\"},{\"$ref\":\"#/definitions/ModuleFilterTypes\"}]},\"excludeAssets\":{\"description\":\"Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.\",\"oneOf\":[{\"$ref\":\"#/definitions/AssetFilterTypes\"}]},\"excludeModules\":{\"description\":\"Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.\",\"anyOf\":[{\"type\":\"boolean\"},{\"$ref\":\"#/definitions/ModuleFilterTypes\"}]},\"groupAssetsByChunk\":{\"description\":\"Group assets by how their are related to chunks.\",\"type\":\"boolean\"},\"groupAssetsByEmitStatus\":{\"description\":\"Group assets by their status (emitted, compared for emit or cached).\",\"type\":\"boolean\"},\"groupAssetsByExtension\":{\"description\":\"Group assets by their extension.\",\"type\":\"boolean\"},\"groupAssetsByInfo\":{\"description\":\"Group assets by their asset info (immutable, development, hotModuleReplacement, etc).\",\"type\":\"boolean\"},\"groupAssetsByPath\":{\"description\":\"Group assets by their path.\",\"type\":\"boolean\"},\"groupModulesByAttributes\":{\"description\":\"Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).\",\"type\":\"boolean\"},\"groupModulesByCacheStatus\":{\"description\":\"Group modules by their status (cached or built and cacheable).\",\"type\":\"boolean\"},\"groupModulesByExtension\":{\"description\":\"Group modules by their extension.\",\"type\":\"boolean\"},\"groupModulesByLayer\":{\"description\":\"Group modules by their layer.\",\"type\":\"boolean\"},\"groupModulesByPath\":{\"description\":\"Group modules by their path.\",\"type\":\"boolean\"},\"groupModulesByType\":{\"description\":\"Group modules by their type.\",\"type\":\"boolean\"},\"groupReasonsByOrigin\":{\"description\":\"Group reasons by their origin module.\",\"type\":\"boolean\"},\"hash\":{\"description\":\"Add the hash of the compilation.\",\"type\":\"boolean\"},\"ids\":{\"description\":\"Add ids.\",\"type\":\"boolean\"},\"logging\":{\"description\":\"Add logging output.\",\"anyOf\":[{\"description\":\"Specify log level of logging output.\",\"enum\":[\"none\",\"error\",\"warn\",\"info\",\"log\",\"verbose\"]},{\"description\":\"Enable/disable logging output (`true`: shows normal logging output, loglevel: log).\",\"type\":\"boolean\"}]},\"loggingDebug\":{\"description\":\"Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.\",\"anyOf\":[{\"description\":\"Enable/Disable debug logging for all loggers.\",\"type\":\"boolean\"},{\"$ref\":\"#/definitions/FilterTypes\"}]},\"loggingTrace\":{\"description\":\"Add stack traces to logging output.\",\"type\":\"boolean\"},\"moduleAssets\":{\"description\":\"Add information about assets inside modules.\",\"type\":\"boolean\"},\"moduleTrace\":{\"description\":\"Add dependencies and origin of warnings/errors.\",\"type\":\"boolean\"},\"modules\":{\"description\":\"Add built modules information.\",\"type\":\"boolean\"},\"modulesSort\":{\"description\":\"Sort the modules by that field.\",\"type\":\"string\"},\"modulesSpace\":{\"description\":\"Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).\",\"type\":\"number\"},\"nestedModules\":{\"description\":\"Add information about modules nested in other modules (like with module concatenation).\",\"type\":\"boolean\"},\"nestedModulesSpace\":{\"description\":\"Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).\",\"type\":\"number\"},\"optimizationBailout\":{\"description\":\"Show reasons why optimization bailed out for modules.\",\"type\":\"boolean\"},\"orphanModules\":{\"description\":\"Add information about orphan modules.\",\"type\":\"boolean\"},\"outputPath\":{\"description\":\"Add output path information.\",\"type\":\"boolean\"},\"performance\":{\"description\":\"Add performance hint flags.\",\"type\":\"boolean\"},\"preset\":{\"description\":\"Preset for the default values.\",\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"string\"}]},\"providedExports\":{\"description\":\"Show exports provided by modules.\",\"type\":\"boolean\"},\"publicPath\":{\"description\":\"Add public path information.\",\"type\":\"boolean\"},\"reasons\":{\"description\":\"Add information about the reasons why modules are included.\",\"type\":\"boolean\"},\"reasonsSpace\":{\"description\":\"Space to display reasons (groups will be collapsed to fit this space).\",\"type\":\"number\"},\"relatedAssets\":{\"description\":\"Add information about assets that are related to other assets (like SourceMaps for assets).\",\"type\":\"boolean\"},\"runtime\":{\"description\":\"Add information about runtime modules (deprecated: use 'runtimeModules' instead).\",\"type\":\"boolean\"},\"runtimeModules\":{\"description\":\"Add information about runtime modules.\",\"type\":\"boolean\"},\"source\":{\"description\":\"Add the source code of modules.\",\"type\":\"boolean\"},\"timings\":{\"description\":\"Add timing information.\",\"type\":\"boolean\"},\"usedExports\":{\"description\":\"Show exports used by modules.\",\"type\":\"boolean\"},\"version\":{\"description\":\"Add webpack version information.\",\"type\":\"boolean\"},\"warnings\":{\"description\":\"Add warnings.\",\"type\":\"boolean\"},\"warningsCount\":{\"description\":\"Add warnings count.\",\"type\":\"boolean\"},\"warningsFilter\":{\"description\":\"Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.\",\"oneOf\":[{\"$ref\":\"#/definitions/WarningFilterTypes\"}]}}},\"StatsValue\":{\"description\":\"Stats options object or preset name.\",\"anyOf\":[{\"enum\":[\"none\",\"summary\",\"errors-only\",\"errors-warnings\",\"minimal\",\"normal\",\"detailed\",\"verbose\"]},{\"type\":\"boolean\"},{\"$ref\":\"#/definitions/StatsOptions\"}]},\"StrictModuleErrorHandling\":{\"description\":\"Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.\",\"type\":\"boolean\"},\"StrictModuleExceptionHandling\":{\"description\":\"Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.\",\"type\":\"boolean\"},\"Target\":{\"description\":\"Environment to build for. An array of environments to build for all of them when possible.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Environment to build for.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1},{\"enum\":[false]},{\"type\":\"string\",\"minLength\":1}]},\"TrustedTypes\":{\"description\":\"Use a Trusted Types policy to create urls for chunks.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"policyName\":{\"description\":\"The name of the Trusted Types policy created by webpack to serve bundle chunks.\",\"type\":\"string\",\"minLength\":1}}},\"UmdNamedDefine\":{\"description\":\"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\",\"type\":\"boolean\"},\"UniqueName\":{\"description\":\"A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.\",\"type\":\"string\",\"minLength\":1},\"WarningFilterItemTypes\":{\"description\":\"Filtering value, regexp or function.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"absolutePath\":false},{\"instanceof\":\"Function\",\"tsType\":\"((warning: import('../lib/stats/DefaultStatsFactoryPlugin').StatsError, value: string) => boolean)\"}]},\"WarningFilterTypes\":{\"description\":\"Filtering warnings.\",\"cli\":{\"helper\":true},\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Rule to filter.\",\"cli\":{\"helper\":true},\"oneOf\":[{\"$ref\":\"#/definitions/WarningFilterItemTypes\"}]}},{\"$ref\":\"#/definitions/WarningFilterItemTypes\"}]},\"WasmLoading\":{\"description\":\"The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).\",\"anyOf\":[{\"enum\":[false]},{\"$ref\":\"#/definitions/WasmLoadingType\"}]},\"WasmLoadingType\":{\"description\":\"The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"fetch-streaming\",\"fetch\",\"async-node\"]},{\"type\":\"string\"}]},\"Watch\":{\"description\":\"Enter watch mode, which rebuilds on file change.\",\"type\":\"boolean\"},\"WatchOptions\":{\"description\":\"Options for the watcher.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"aggregateTimeout\":{\"description\":\"Delay the rebuilt after the first change. Value is a time in ms.\",\"type\":\"number\"},\"followSymlinks\":{\"description\":\"Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').\",\"type\":\"boolean\"},\"ignored\":{\"description\":\"Ignore some files from watching (glob pattern or regexp).\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A glob pattern for files that should be ignored from watching.\",\"type\":\"string\",\"minLength\":1}},{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"A single glob pattern for files that should be ignored from watching.\",\"type\":\"string\",\"minLength\":1}]},\"poll\":{\"description\":\"Enable polling mode for watching.\",\"anyOf\":[{\"description\":\"`number`: use polling with specified interval.\",\"type\":\"number\"},{\"description\":\"`true`: use polling.\",\"type\":\"boolean\"}]},\"stdin\":{\"description\":\"Stop watching when stdin stream has ended.\",\"type\":\"boolean\"}}},\"WebassemblyModuleFilename\":{\"description\":\"The filename of WebAssembly modules as relative path inside the 'output.path' directory.\",\"type\":\"string\",\"absolutePath\":false},\"WebpackOptionsNormalized\":{\"description\":\"Normalized webpack options object.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"$ref\":\"#/definitions/Amd\"},\"bail\":{\"$ref\":\"#/definitions/Bail\"},\"cache\":{\"$ref\":\"#/definitions/CacheOptionsNormalized\"},\"context\":{\"$ref\":\"#/definitions/Context\"},\"dependencies\":{\"$ref\":\"#/definitions/Dependencies\"},\"devServer\":{\"$ref\":\"#/definitions/DevServer\"},\"devtool\":{\"$ref\":\"#/definitions/DevTool\"},\"entry\":{\"$ref\":\"#/definitions/EntryNormalized\"},\"experiments\":{\"$ref\":\"#/definitions/ExperimentsNormalized\"},\"externals\":{\"$ref\":\"#/definitions/Externals\"},\"externalsPresets\":{\"$ref\":\"#/definitions/ExternalsPresets\"},\"externalsType\":{\"$ref\":\"#/definitions/ExternalsType\"},\"ignoreWarnings\":{\"$ref\":\"#/definitions/IgnoreWarningsNormalized\"},\"infrastructureLogging\":{\"$ref\":\"#/definitions/InfrastructureLogging\"},\"loader\":{\"$ref\":\"#/definitions/Loader\"},\"mode\":{\"$ref\":\"#/definitions/Mode\"},\"module\":{\"$ref\":\"#/definitions/ModuleOptionsNormalized\"},\"name\":{\"$ref\":\"#/definitions/Name\"},\"node\":{\"$ref\":\"#/definitions/Node\"},\"optimization\":{\"$ref\":\"#/definitions/Optimization\"},\"output\":{\"$ref\":\"#/definitions/OutputNormalized\"},\"parallelism\":{\"$ref\":\"#/definitions/Parallelism\"},\"performance\":{\"$ref\":\"#/definitions/Performance\"},\"plugins\":{\"$ref\":\"#/definitions/Plugins\"},\"profile\":{\"$ref\":\"#/definitions/Profile\"},\"recordsInputPath\":{\"$ref\":\"#/definitions/RecordsInputPath\"},\"recordsOutputPath\":{\"$ref\":\"#/definitions/RecordsOutputPath\"},\"resolve\":{\"$ref\":\"#/definitions/Resolve\"},\"resolveLoader\":{\"$ref\":\"#/definitions/ResolveLoader\"},\"snapshot\":{\"$ref\":\"#/definitions/SnapshotOptions\"},\"stats\":{\"$ref\":\"#/definitions/StatsValue\"},\"target\":{\"$ref\":\"#/definitions/Target\"},\"watch\":{\"$ref\":\"#/definitions/Watch\"},\"watchOptions\":{\"$ref\":\"#/definitions/WatchOptions\"}},\"required\":[\"cache\",\"snapshot\",\"entry\",\"experiments\",\"externals\",\"externalsPresets\",\"infrastructureLogging\",\"module\",\"node\",\"optimization\",\"output\",\"plugins\",\"resolve\",\"resolveLoader\",\"stats\",\"watchOptions\"]},\"WebpackPluginFunction\":{\"description\":\"Function acting as plugin.\",\"instanceof\":\"Function\",\"tsType\":\"(this: import('../lib/Compiler'), compiler: import('../lib/Compiler')) => void\"},\"WebpackPluginInstance\":{\"description\":\"Plugin instance.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"apply\":{\"description\":\"The run point of the plugin, required method.\",\"instanceof\":\"Function\",\"tsType\":\"(compiler: import('../lib/Compiler')) => void\"}},\"required\":[\"apply\"]}},\"title\":\"WebpackOptions\",\"description\":\"Options object as provided by the user.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"$ref\":\"#/definitions/Amd\"},\"bail\":{\"$ref\":\"#/definitions/Bail\"},\"cache\":{\"$ref\":\"#/definitions/CacheOptions\"},\"context\":{\"$ref\":\"#/definitions/Context\"},\"dependencies\":{\"$ref\":\"#/definitions/Dependencies\"},\"devServer\":{\"$ref\":\"#/definitions/DevServer\"},\"devtool\":{\"$ref\":\"#/definitions/DevTool\"},\"entry\":{\"$ref\":\"#/definitions/Entry\"},\"experiments\":{\"$ref\":\"#/definitions/Experiments\"},\"externals\":{\"$ref\":\"#/definitions/Externals\"},\"externalsPresets\":{\"$ref\":\"#/definitions/ExternalsPresets\"},\"externalsType\":{\"$ref\":\"#/definitions/ExternalsType\"},\"ignoreWarnings\":{\"$ref\":\"#/definitions/IgnoreWarnings\"},\"infrastructureLogging\":{\"$ref\":\"#/definitions/InfrastructureLogging\"},\"loader\":{\"$ref\":\"#/definitions/Loader\"},\"mode\":{\"$ref\":\"#/definitions/Mode\"},\"module\":{\"$ref\":\"#/definitions/ModuleOptions\"},\"name\":{\"$ref\":\"#/definitions/Name\"},\"node\":{\"$ref\":\"#/definitions/Node\"},\"optimization\":{\"$ref\":\"#/definitions/Optimization\"},\"output\":{\"$ref\":\"#/definitions/Output\"},\"parallelism\":{\"$ref\":\"#/definitions/Parallelism\"},\"performance\":{\"$ref\":\"#/definitions/Performance\"},\"plugins\":{\"$ref\":\"#/definitions/Plugins\"},\"profile\":{\"$ref\":\"#/definitions/Profile\"},\"recordsInputPath\":{\"$ref\":\"#/definitions/RecordsInputPath\"},\"recordsOutputPath\":{\"$ref\":\"#/definitions/RecordsOutputPath\"},\"recordsPath\":{\"$ref\":\"#/definitions/RecordsPath\"},\"resolve\":{\"$ref\":\"#/definitions/Resolve\"},\"resolveLoader\":{\"$ref\":\"#/definitions/ResolveLoader\"},\"snapshot\":{\"$ref\":\"#/definitions/SnapshotOptions\"},\"stats\":{\"$ref\":\"#/definitions/StatsValue\"},\"target\":{\"$ref\":\"#/definitions/Target\"},\"watch\":{\"$ref\":\"#/definitions/Watch\"},\"watchOptions\":{\"$ref\":\"#/definitions/WatchOptions\"}}}"); /***/ }), /***/ 33946: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"BannerFunction\":{\"description\":\"The banner as function, it will be wrapped in a comment.\",\"instanceof\":\"Function\",\"tsType\":\"(data: { hash: string, chunk: import('../../lib/Chunk'), filename: string }) => string\"},\"Rule\":{\"description\":\"Filtering rule as regex or string.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"minLength\":1}]},\"Rules\":{\"description\":\"Filtering rules.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A rule condition.\",\"oneOf\":[{\"$ref\":\"#/definitions/Rule\"}]}},{\"$ref\":\"#/definitions/Rule\"}]}},\"title\":\"BannerPluginArgument\",\"anyOf\":[{\"description\":\"The banner as string, it will be wrapped in a comment.\",\"type\":\"string\",\"minLength\":1},{\"title\":\"BannerPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"banner\":{\"description\":\"Specifies the banner.\",\"anyOf\":[{\"type\":\"string\"},{\"$ref\":\"#/definitions/BannerFunction\"}]},\"entryOnly\":{\"description\":\"If true, the banner will only be added to the entry chunks.\",\"type\":\"boolean\"},\"exclude\":{\"description\":\"Exclude all modules matching any of these conditions.\",\"oneOf\":[{\"$ref\":\"#/definitions/Rules\"}]},\"include\":{\"description\":\"Include all modules matching any of these conditions.\",\"oneOf\":[{\"$ref\":\"#/definitions/Rules\"}]},\"raw\":{\"description\":\"If true, banner will not be wrapped in a comment.\",\"type\":\"boolean\"},\"test\":{\"description\":\"Include all modules that pass test assertion.\",\"oneOf\":[{\"$ref\":\"#/definitions/Rules\"}]}},\"required\":[\"banner\"]},{\"$ref\":\"#/definitions/BannerFunction\"}]}"); /***/ }), /***/ 7754: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"DllPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"context\":{\"description\":\"Context of requests in the manifest file (defaults to the webpack context).\",\"type\":\"string\",\"minLength\":1},\"entryOnly\":{\"description\":\"If true, only entry points will be exposed (default: true).\",\"type\":\"boolean\"},\"format\":{\"description\":\"If true, manifest json file (output) will be formatted.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Name of the exposed dll function (external name, use value of 'output.library').\",\"type\":\"string\",\"minLength\":1},\"path\":{\"description\":\"Absolute path to the manifest json file (output).\",\"type\":\"string\",\"minLength\":1},\"type\":{\"description\":\"Type of the dll bundle (external type, use value of 'output.libraryTarget').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"path\"]}"); /***/ }), /***/ 15766: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"DllReferencePluginOptionsContent\":{\"description\":\"The mappings from request to module info.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Module info.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"buildMeta\":{\"description\":\"Meta information about the module.\",\"type\":\"object\"},\"exports\":{\"description\":\"Information about the provided exports of the module.\",\"anyOf\":[{\"description\":\"List of provided exports of the module.\",\"type\":\"array\",\"items\":{\"description\":\"Name of the export.\",\"type\":\"string\",\"minLength\":1}},{\"description\":\"Exports unknown/dynamic.\",\"enum\":[true]}]},\"id\":{\"description\":\"Module ID.\",\"anyOf\":[{\"type\":\"number\"},{\"type\":\"string\",\"minLength\":1}]}},\"required\":[\"id\"]},\"minProperties\":1},\"DllReferencePluginOptionsManifest\":{\"description\":\"An object containing content, name and type.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"content\":{\"description\":\"The mappings from request to module info.\",\"oneOf\":[{\"$ref\":\"#/definitions/DllReferencePluginOptionsContent\"}]},\"name\":{\"description\":\"The name where the dll is exposed (external name).\",\"type\":\"string\",\"minLength\":1},\"type\":{\"description\":\"The type how the dll is exposed (external type).\",\"oneOf\":[{\"$ref\":\"#/definitions/DllReferencePluginOptionsSourceType\"}]}},\"required\":[\"content\"]},\"DllReferencePluginOptionsSourceType\":{\"description\":\"The type how the dll is exposed (external type).\",\"enum\":[\"var\",\"assign\",\"this\",\"window\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\"]}},\"title\":\"DllReferencePluginOptions\",\"anyOf\":[{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"context\":{\"description\":\"Context of requests in the manifest (or content property) as absolute path.\",\"type\":\"string\",\"absolutePath\":true},\"extensions\":{\"description\":\"Extensions used to resolve modules in the dll bundle (only used when using 'scope').\",\"type\":\"array\",\"items\":{\"description\":\"An extension.\",\"type\":\"string\"}},\"manifest\":{\"description\":\"An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.\",\"anyOf\":[{\"type\":\"string\",\"absolutePath\":true},{\"$ref\":\"#/definitions/DllReferencePluginOptionsManifest\"}]},\"name\":{\"description\":\"The name where the dll is exposed (external name, defaults to manifest.name).\",\"type\":\"string\",\"minLength\":1},\"scope\":{\"description\":\"Prefix which is used for accessing the content of the dll.\",\"type\":\"string\",\"minLength\":1},\"sourceType\":{\"description\":\"How the dll is exposed (libraryTarget, defaults to manifest.type).\",\"oneOf\":[{\"$ref\":\"#/definitions/DllReferencePluginOptionsSourceType\"}]},\"type\":{\"description\":\"The way how the export of the dll bundle is used.\",\"enum\":[\"require\",\"object\"]}},\"required\":[\"manifest\"]},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"content\":{\"description\":\"The mappings from request to module info.\",\"oneOf\":[{\"$ref\":\"#/definitions/DllReferencePluginOptionsContent\"}]},\"context\":{\"description\":\"Context of requests in the manifest (or content property) as absolute path.\",\"type\":\"string\",\"absolutePath\":true},\"extensions\":{\"description\":\"Extensions used to resolve modules in the dll bundle (only used when using 'scope').\",\"type\":\"array\",\"items\":{\"description\":\"An extension.\",\"type\":\"string\"}},\"name\":{\"description\":\"The name where the dll is exposed (external name).\",\"type\":\"string\",\"minLength\":1},\"scope\":{\"description\":\"Prefix which is used for accessing the content of the dll.\",\"type\":\"string\",\"minLength\":1},\"sourceType\":{\"description\":\"How the dll is exposed (libraryTarget).\",\"oneOf\":[{\"$ref\":\"#/definitions/DllReferencePluginOptionsSourceType\"}]},\"type\":{\"description\":\"The way how the export of the dll bundle is used.\",\"enum\":[\"require\",\"object\"]}},\"required\":[\"content\",\"name\"]}]}"); /***/ }), /***/ 72864: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"HashFunction\":{\"description\":\"Algorithm used for generation the hash (see node.js crypto package).\",\"anyOf\":[{\"type\":\"string\",\"minLength\":1},{\"instanceof\":\"Function\",\"tsType\":\"typeof import('../../lib/util/Hash')\"}]}},\"title\":\"HashedModuleIdsPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"context\":{\"description\":\"The context directory for creating names.\",\"type\":\"string\",\"absolutePath\":true},\"hashDigest\":{\"description\":\"The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.\",\"enum\":[\"hex\",\"latin1\",\"base64\"]},\"hashDigestLength\":{\"description\":\"The prefix length of the hash digest to use, defaults to 4.\",\"type\":\"number\",\"minimum\":1},\"hashFunction\":{\"description\":\"The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.\",\"oneOf\":[{\"$ref\":\"#/definitions/HashFunction\"}]}}}"); /***/ }), /***/ 51856: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"IgnorePluginOptions\",\"anyOf\":[{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"contextRegExp\":{\"description\":\"A RegExp to test the context (directory) against.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},\"resourceRegExp\":{\"description\":\"A RegExp to test the request against.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"}},\"required\":[\"resourceRegExp\"]},{\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"checkResource\":{\"description\":\"A filter function for resource and context.\",\"instanceof\":\"Function\",\"tsType\":\"((resource: string, context: string) => boolean)\"}},\"required\":[\"checkResource\"]}]}"); /***/ }), /***/ 15685: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"JsonModulesPluginParserOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"parse\":{\"description\":\"Function that executes for a module source string and should return json-compatible data.\",\"instanceof\":\"Function\",\"tsType\":\"((input: string) => any)\"}}}"); /***/ }), /***/ 56086: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"LoaderOptionsPluginOptions\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"debug\":{\"description\":\"Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.\",\"type\":\"boolean\"},\"minimize\":{\"description\":\"Where loaders can be switched to minimize mode.\",\"type\":\"boolean\"},\"options\":{\"description\":\"A configuration object that can be used to configure older loaders.\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"context\":{\"description\":\"The context that can be used to configure older loaders.\",\"type\":\"string\",\"absolutePath\":true}}}}}"); /***/ }), /***/ 98777: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"HandlerFunction\":{\"description\":\"Function that executes for every progress step.\",\"instanceof\":\"Function\",\"tsType\":\"((percentage: number, msg: string, ...args: string[]) => void)\"},\"ProgressPluginOptions\":{\"description\":\"Options object for the ProgressPlugin.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"activeModules\":{\"description\":\"Show active modules count and one active module in progress message.\",\"type\":\"boolean\"},\"dependencies\":{\"description\":\"Show dependencies count in progress message.\",\"type\":\"boolean\"},\"dependenciesCount\":{\"description\":\"Minimum dependencies count to start with. For better progress calculation. Default: 10000.\",\"type\":\"number\"},\"entries\":{\"description\":\"Show entries count in progress message.\",\"type\":\"boolean\"},\"handler\":{\"description\":\"Function that executes for every progress step.\",\"oneOf\":[{\"$ref\":\"#/definitions/HandlerFunction\"}]},\"modules\":{\"description\":\"Show modules count in progress message.\",\"type\":\"boolean\"},\"modulesCount\":{\"description\":\"Minimum modules count to start with. For better progress calculation. Default: 5000.\",\"type\":\"number\"},\"percentBy\":{\"description\":\"Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.\",\"enum\":[\"entries\",\"modules\",\"dependencies\",null]},\"profile\":{\"description\":\"Collect profile data for progress steps. Default: false.\",\"enum\":[true,false,null]}}}},\"title\":\"ProgressPluginArgument\",\"anyOf\":[{\"$ref\":\"#/definitions/ProgressPluginOptions\"},{\"$ref\":\"#/definitions/HandlerFunction\"}]}"); /***/ }), /***/ 95228: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"rule\":{\"description\":\"Include source maps for modules based on their extension (defaults to .js and .css).\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\",\"minLength\":1}]},\"rules\":{\"description\":\"Include source maps for modules based on their extension (defaults to .js and .css).\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A rule condition.\",\"oneOf\":[{\"$ref\":\"#/definitions/rule\"}]}},{\"$ref\":\"#/definitions/rule\"}]}},\"title\":\"SourceMapDevToolPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"append\":{\"description\":\"Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.\",\"anyOf\":[{\"description\":\"Append no SourceMap comment to the bundle, but still generate SourceMaps.\",\"enum\":[false,null]},{\"type\":\"string\",\"minLength\":1}]},\"columns\":{\"description\":\"Indicates whether column mappings should be used (defaults to true).\",\"type\":\"boolean\"},\"exclude\":{\"description\":\"Exclude modules that match the given value from source map generation.\",\"oneOf\":[{\"$ref\":\"#/definitions/rules\"}]},\"fallbackModuleFilenameTemplate\":{\"description\":\"Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.\",\"anyOf\":[{\"type\":\"string\",\"minLength\":1},{\"description\":\"Custom function generating the identifier.\",\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"fileContext\":{\"description\":\"Path prefix to which the [file] placeholder is relative to.\",\"type\":\"string\"},\"filename\":{\"description\":\"Defines the output filename of the SourceMap (will be inlined if no value is provided).\",\"anyOf\":[{\"description\":\"Disable separate SourceMap file and inline SourceMap as DataUrl.\",\"enum\":[false,null]},{\"type\":\"string\",\"absolutePath\":false,\"minLength\":1}]},\"include\":{\"description\":\"Include source maps for module paths that match the given value.\",\"oneOf\":[{\"$ref\":\"#/definitions/rules\"}]},\"module\":{\"description\":\"Indicates whether SourceMaps from loaders should be used (defaults to true).\",\"type\":\"boolean\"},\"moduleFilenameTemplate\":{\"description\":\"Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.\",\"anyOf\":[{\"type\":\"string\",\"minLength\":1},{\"description\":\"Custom function generating the identifier.\",\"instanceof\":\"Function\",\"tsType\":\"Function\"}]},\"namespace\":{\"description\":\"Namespace prefix to allow multiple webpack roots in the devtools.\",\"type\":\"string\"},\"noSources\":{\"description\":\"Omit the 'sourceContents' array from the SourceMap.\",\"type\":\"boolean\"},\"publicPath\":{\"description\":\"Provide a custom public path for the SourceMapping comment.\",\"type\":\"string\"},\"sourceRoot\":{\"description\":\"Provide a custom value for the 'sourceRoot' property in the SourceMap.\",\"type\":\"string\"},\"test\":{\"$ref\":\"#/definitions/rules\"}}}"); /***/ }), /***/ 66489: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"WatchIgnorePluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"paths\":{\"description\":\"A list of RegExps or absolute paths to directories or files that should be ignored.\",\"type\":\"array\",\"items\":{\"description\":\"RegExp or absolute path to directories or files that should be ignored.\",\"anyOf\":[{\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"type\":\"string\"}]},\"minItems\":1}},\"required\":[\"paths\"]}"); /***/ }), /***/ 18374: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"AuxiliaryComment\":{\"description\":\"Add a comment in the UMD wrapper.\",\"anyOf\":[{\"description\":\"Append the same comment above each import style.\",\"type\":\"string\"},{\"$ref\":\"#/definitions/LibraryCustomUmdCommentObject\"}]},\"EntryRuntime\":{\"description\":\"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"minLength\":1}]},\"Exposes\":{\"description\":\"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesObject\"}]}},{\"$ref\":\"#/definitions/ExposesObject\"}]},\"ExposesConfig\":{\"description\":\"Advanced configuration for modules that should be exposed by this container.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"import\":{\"description\":\"Request to a module that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesItems\"}]},\"name\":{\"description\":\"Custom chunk name for the exposed module.\",\"type\":\"string\"}},\"required\":[\"import\"]},\"ExposesItem\":{\"description\":\"Module that should be exposed by this container.\",\"type\":\"string\",\"minLength\":1},\"ExposesItems\":{\"description\":\"Modules that should be exposed by this container.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/ExposesItem\"}},\"ExposesObject\":{\"description\":\"Modules that should be exposed by this container. Property names are used as public paths.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesConfig\"},{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesItems\"}]}},\"LibraryCustomUmdCommentObject\":{\"description\":\"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Set comment for `amd` section in UMD.\",\"type\":\"string\"},\"commonjs\":{\"description\":\"Set comment for `commonjs` (exports) section in UMD.\",\"type\":\"string\"},\"commonjs2\":{\"description\":\"Set comment for `commonjs2` (module.exports) section in UMD.\",\"type\":\"string\"},\"root\":{\"description\":\"Set comment for `root` (global variable) section in UMD.\",\"type\":\"string\"}}},\"LibraryCustomUmdObject\":{\"description\":\"Description object for all UMD variants of the library name.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Name of the exposed AMD library in the UMD.\",\"type\":\"string\",\"minLength\":1},\"commonjs\":{\"description\":\"Name of the exposed commonjs export in the UMD.\",\"type\":\"string\",\"minLength\":1},\"root\":{\"description\":\"Name of the property exposed globally by a UMD library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the name of the property exposed globally by a UMD library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]}}},\"LibraryExport\":{\"description\":\"Specify which export should be exposed as library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the export that should be exposed as library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]},\"LibraryName\":{\"description\":\"The name of the library (some types allow unnamed libraries too).\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A part of the library name.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1},{\"type\":\"string\",\"minLength\":1},{\"$ref\":\"#/definitions/LibraryCustomUmdObject\"}]},\"LibraryOptions\":{\"description\":\"Options for library.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"auxiliaryComment\":{\"$ref\":\"#/definitions/AuxiliaryComment\"},\"export\":{\"$ref\":\"#/definitions/LibraryExport\"},\"name\":{\"$ref\":\"#/definitions/LibraryName\"},\"type\":{\"$ref\":\"#/definitions/LibraryType\"},\"umdNamedDefine\":{\"$ref\":\"#/definitions/UmdNamedDefine\"}},\"required\":[\"type\"]},\"LibraryType\":{\"description\":\"Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"var\",\"module\",\"assign\",\"assign-properties\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\"]},{\"type\":\"string\"}]},\"UmdNamedDefine\":{\"description\":\"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\",\"type\":\"boolean\"}},\"title\":\"ContainerPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"exposes\":{\"$ref\":\"#/definitions/Exposes\"},\"filename\":{\"description\":\"The filename for this container relative path inside the `output.path` directory.\",\"type\":\"string\",\"absolutePath\":false,\"minLength\":1},\"library\":{\"$ref\":\"#/definitions/LibraryOptions\"},\"name\":{\"description\":\"The name for this container.\",\"type\":\"string\",\"minLength\":1},\"runtime\":{\"$ref\":\"#/definitions/EntryRuntime\"},\"shareScope\":{\"description\":\"The name of the share scope which is shared with the host (defaults to 'default').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"name\",\"exposes\"]}"); /***/ }), /***/ 31339: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"ExternalsType\":{\"description\":\"Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).\",\"enum\":[\"var\",\"module\",\"assign\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\",\"promise\",\"import\",\"script\",\"node-commonjs\"]},\"Remotes\":{\"description\":\"Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Container locations and request scopes from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesObject\"}]}},{\"$ref\":\"#/definitions/RemotesObject\"}]},\"RemotesConfig\":{\"description\":\"Advanced configuration for container locations from which modules should be resolved and loaded at runtime.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"external\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesItems\"}]},\"shareScope\":{\"description\":\"The name of the share scope shared with this remote.\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"external\"]},\"RemotesItem\":{\"description\":\"Container location from which modules should be resolved and loaded at runtime.\",\"type\":\"string\",\"minLength\":1},\"RemotesItems\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/RemotesItem\"}},\"RemotesObject\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesConfig\"},{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesItems\"}]}}},\"title\":\"ContainerReferencePluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"remoteType\":{\"description\":\"The external type of the remote containers.\",\"oneOf\":[{\"$ref\":\"#/definitions/ExternalsType\"}]},\"remotes\":{\"$ref\":\"#/definitions/Remotes\"},\"shareScope\":{\"description\":\"The name of the share scope shared with all remotes (defaults to 'default').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"remoteType\",\"remotes\"]}"); /***/ }), /***/ 2320: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"AuxiliaryComment\":{\"description\":\"Add a comment in the UMD wrapper.\",\"anyOf\":[{\"description\":\"Append the same comment above each import style.\",\"type\":\"string\"},{\"$ref\":\"#/definitions/LibraryCustomUmdCommentObject\"}]},\"EntryRuntime\":{\"description\":\"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"minLength\":1}]},\"Exposes\":{\"description\":\"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesObject\"}]}},{\"$ref\":\"#/definitions/ExposesObject\"}]},\"ExposesConfig\":{\"description\":\"Advanced configuration for modules that should be exposed by this container.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"import\":{\"description\":\"Request to a module that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesItems\"}]},\"name\":{\"description\":\"Custom chunk name for the exposed module.\",\"type\":\"string\"}},\"required\":[\"import\"]},\"ExposesItem\":{\"description\":\"Module that should be exposed by this container.\",\"type\":\"string\",\"minLength\":1},\"ExposesItems\":{\"description\":\"Modules that should be exposed by this container.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/ExposesItem\"}},\"ExposesObject\":{\"description\":\"Modules that should be exposed by this container. Property names are used as public paths.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be exposed by this container.\",\"anyOf\":[{\"$ref\":\"#/definitions/ExposesConfig\"},{\"$ref\":\"#/definitions/ExposesItem\"},{\"$ref\":\"#/definitions/ExposesItems\"}]}},\"ExternalsType\":{\"description\":\"Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).\",\"enum\":[\"var\",\"module\",\"assign\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\",\"promise\",\"import\",\"script\",\"node-commonjs\"]},\"LibraryCustomUmdCommentObject\":{\"description\":\"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Set comment for `amd` section in UMD.\",\"type\":\"string\"},\"commonjs\":{\"description\":\"Set comment for `commonjs` (exports) section in UMD.\",\"type\":\"string\"},\"commonjs2\":{\"description\":\"Set comment for `commonjs2` (module.exports) section in UMD.\",\"type\":\"string\"},\"root\":{\"description\":\"Set comment for `root` (global variable) section in UMD.\",\"type\":\"string\"}}},\"LibraryCustomUmdObject\":{\"description\":\"Description object for all UMD variants of the library name.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"amd\":{\"description\":\"Name of the exposed AMD library in the UMD.\",\"type\":\"string\",\"minLength\":1},\"commonjs\":{\"description\":\"Name of the exposed commonjs export in the UMD.\",\"type\":\"string\",\"minLength\":1},\"root\":{\"description\":\"Name of the property exposed globally by a UMD library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the name of the property exposed globally by a UMD library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]}}},\"LibraryExport\":{\"description\":\"Specify which export should be exposed as library.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Part of the export that should be exposed as library.\",\"type\":\"string\",\"minLength\":1}},{\"type\":\"string\",\"minLength\":1}]},\"LibraryName\":{\"description\":\"The name of the library (some types allow unnamed libraries too).\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"A part of the library name.\",\"type\":\"string\",\"minLength\":1},\"minItems\":1},{\"type\":\"string\",\"minLength\":1},{\"$ref\":\"#/definitions/LibraryCustomUmdObject\"}]},\"LibraryOptions\":{\"description\":\"Options for library.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"auxiliaryComment\":{\"$ref\":\"#/definitions/AuxiliaryComment\"},\"export\":{\"$ref\":\"#/definitions/LibraryExport\"},\"name\":{\"$ref\":\"#/definitions/LibraryName\"},\"type\":{\"$ref\":\"#/definitions/LibraryType\"},\"umdNamedDefine\":{\"$ref\":\"#/definitions/UmdNamedDefine\"}},\"required\":[\"type\"]},\"LibraryType\":{\"description\":\"Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\",\"anyOf\":[{\"enum\":[\"var\",\"module\",\"assign\",\"assign-properties\",\"this\",\"window\",\"self\",\"global\",\"commonjs\",\"commonjs2\",\"commonjs-module\",\"amd\",\"amd-require\",\"umd\",\"umd2\",\"jsonp\",\"system\"]},{\"type\":\"string\"}]},\"Remotes\":{\"description\":\"Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Container locations and request scopes from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesObject\"}]}},{\"$ref\":\"#/definitions/RemotesObject\"}]},\"RemotesConfig\":{\"description\":\"Advanced configuration for container locations from which modules should be resolved and loaded at runtime.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"external\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesItems\"}]},\"shareScope\":{\"description\":\"The name of the share scope shared with this remote.\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"external\"]},\"RemotesItem\":{\"description\":\"Container location from which modules should be resolved and loaded at runtime.\",\"type\":\"string\",\"minLength\":1},\"RemotesItems\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/RemotesItem\"}},\"RemotesObject\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Container locations from which modules should be resolved and loaded at runtime.\",\"anyOf\":[{\"$ref\":\"#/definitions/RemotesConfig\"},{\"$ref\":\"#/definitions/RemotesItem\"},{\"$ref\":\"#/definitions/RemotesItems\"}]}},\"Shared\":{\"description\":\"Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be shared in the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/SharedItem\"},{\"$ref\":\"#/definitions/SharedObject\"}]}},{\"$ref\":\"#/definitions/SharedObject\"}]},\"SharedConfig\":{\"description\":\"Advanced configuration for modules that should be shared in the share scope.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"eager\":{\"description\":\"Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.\",\"type\":\"boolean\"},\"import\":{\"description\":\"Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.\",\"anyOf\":[{\"description\":\"No provided or fallback module.\",\"enum\":[false]},{\"$ref\":\"#/definitions/SharedItem\"}]},\"packageName\":{\"description\":\"Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.\",\"type\":\"string\",\"minLength\":1},\"requiredVersion\":{\"description\":\"Version requirement from module in share scope.\",\"anyOf\":[{\"description\":\"No version requirement check.\",\"enum\":[false]},{\"description\":\"Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.\",\"type\":\"string\"}]},\"shareKey\":{\"description\":\"Module is looked up under this key from the share scope.\",\"type\":\"string\",\"minLength\":1},\"shareScope\":{\"description\":\"Share scope name.\",\"type\":\"string\",\"minLength\":1},\"singleton\":{\"description\":\"Allow only a single version of the shared module in share scope (disabled by default).\",\"type\":\"boolean\"},\"strictVersion\":{\"description\":\"Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).\",\"type\":\"boolean\"},\"version\":{\"description\":\"Version of the provided module. Will replace lower matching versions, but not higher.\",\"anyOf\":[{\"description\":\"Don't provide a version.\",\"enum\":[false]},{\"description\":\"Version as string. Each part of the version should be separated by a dot '.'.\",\"type\":\"string\"}]}}},\"SharedItem\":{\"description\":\"A module that should be shared in the share scope.\",\"type\":\"string\",\"minLength\":1},\"SharedObject\":{\"description\":\"Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be shared in the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/SharedConfig\"},{\"$ref\":\"#/definitions/SharedItem\"}]}},\"UmdNamedDefine\":{\"description\":\"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\",\"type\":\"boolean\"}},\"title\":\"ModuleFederationPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"exposes\":{\"$ref\":\"#/definitions/Exposes\"},\"filename\":{\"description\":\"The filename of the container as relative path inside the `output.path` directory.\",\"type\":\"string\",\"absolutePath\":false},\"library\":{\"$ref\":\"#/definitions/LibraryOptions\"},\"name\":{\"description\":\"The name of the container.\",\"type\":\"string\"},\"remoteType\":{\"description\":\"The external type of the remote containers.\",\"oneOf\":[{\"$ref\":\"#/definitions/ExternalsType\"}]},\"remotes\":{\"$ref\":\"#/definitions/Remotes\"},\"runtime\":{\"$ref\":\"#/definitions/EntryRuntime\"},\"shareScope\":{\"description\":\"Share scope name used for all shared modules (defaults to 'default').\",\"type\":\"string\",\"minLength\":1},\"shared\":{\"$ref\":\"#/definitions/Shared\"}}}"); /***/ }), /***/ 26281: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"ProfilingPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"outputPath\":{\"description\":\"Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.\",\"type\":\"string\",\"absolutePath\":true}}}"); /***/ }), /***/ 7435: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"OccurrenceChunkIdsPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"prioritiseInitial\":{\"description\":\"Prioritise initial size over total size.\",\"type\":\"boolean\"}}}"); /***/ }), /***/ 88570: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"OccurrenceModuleIdsPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"prioritiseInitial\":{\"description\":\"Prioritise initial size over total size.\",\"type\":\"boolean\"}}}"); /***/ }), /***/ 3572: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"AggressiveSplittingPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"chunkOverhead\":{\"description\":\"Extra cost for each chunk (Default: 9.8kiB).\",\"type\":\"number\"},\"entryChunkMultiplicator\":{\"description\":\"Extra cost multiplicator for entry chunks (Default: 10).\",\"type\":\"number\"},\"maxSize\":{\"description\":\"Byte, max size of per file (Default: 50kiB).\",\"type\":\"number\"},\"minSize\":{\"description\":\"Byte, split point. (Default: 30kiB).\",\"type\":\"number\"}}}"); /***/ }), /***/ 58898: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"LimitChunkCountPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"chunkOverhead\":{\"description\":\"Constant overhead for a chunk.\",\"type\":\"number\"},\"entryChunkMultiplicator\":{\"description\":\"Multiplicator for initial chunks.\",\"type\":\"number\"},\"maxChunks\":{\"description\":\"Limit the maximum number of chunks using a value greater greater than or equal to 1.\",\"type\":\"number\",\"minimum\":1}},\"required\":[\"maxChunks\"]}"); /***/ }), /***/ 66480: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"title\":\"MinChunkSizePluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"chunkOverhead\":{\"description\":\"Constant overhead for a chunk.\",\"type\":\"number\"},\"entryChunkMultiplicator\":{\"description\":\"Multiplicator for initial chunks.\",\"type\":\"number\"},\"minChunkSize\":{\"description\":\"Minimum number of characters.\",\"type\":\"number\"}},\"required\":[\"minChunkSize\"]}"); /***/ }), /***/ 75110: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"HttpUriOptions\":{\"description\":\"Options for building http resources.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"allowedUris\":{\"$ref\":\"#/definitions/HttpUriOptionsAllowedUris\"},\"cacheLocation\":{\"description\":\"Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.\",\"anyOf\":[{\"enum\":[false]},{\"type\":\"string\",\"absolutePath\":true}]},\"frozen\":{\"description\":\"When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.\",\"type\":\"boolean\"},\"lockfileLocation\":{\"description\":\"Location of the lockfile.\",\"type\":\"string\",\"absolutePath\":true},\"upgrade\":{\"description\":\"When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.\",\"type\":\"boolean\"}},\"required\":[\"allowedUris\"]},\"HttpUriOptionsAllowedUris\":{\"description\":\"List of allowed URIs (resp. the beginning of them).\",\"type\":\"array\",\"items\":{\"description\":\"List of allowed URIs (resp. the beginning of them).\",\"anyOf\":[{\"description\":\"Allowed URI pattern.\",\"instanceof\":\"RegExp\",\"tsType\":\"RegExp\"},{\"description\":\"Allowed URI (resp. the beginning of it).\",\"type\":\"string\",\"pattern\":\"^https?://\"},{\"description\":\"Allowed URI filter function.\",\"instanceof\":\"Function\",\"tsType\":\"((uri: string) => boolean)\"}]}}},\"title\":\"HttpUriPluginOptions\",\"oneOf\":[{\"$ref\":\"#/definitions/HttpUriOptions\"}]}"); /***/ }), /***/ 9515: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"Consumes\":{\"description\":\"Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be consumed from share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ConsumesItem\"},{\"$ref\":\"#/definitions/ConsumesObject\"}]}},{\"$ref\":\"#/definitions/ConsumesObject\"}]},\"ConsumesConfig\":{\"description\":\"Advanced configuration for modules that should be consumed from share scope.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"eager\":{\"description\":\"Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.\",\"type\":\"boolean\"},\"import\":{\"description\":\"Fallback module if no shared module is found in share scope. Defaults to the property name.\",\"anyOf\":[{\"description\":\"No fallback module.\",\"enum\":[false]},{\"$ref\":\"#/definitions/ConsumesItem\"}]},\"packageName\":{\"description\":\"Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.\",\"type\":\"string\",\"minLength\":1},\"requiredVersion\":{\"description\":\"Version requirement from module in share scope.\",\"anyOf\":[{\"description\":\"No version requirement check.\",\"enum\":[false]},{\"description\":\"Version as string. Can be prefixed with '^' or '~' for minimum matches. Each part of the version should be separated by a dot '.'.\",\"type\":\"string\"}]},\"shareKey\":{\"description\":\"Module is looked up under this key from the share scope.\",\"type\":\"string\",\"minLength\":1},\"shareScope\":{\"description\":\"Share scope name.\",\"type\":\"string\",\"minLength\":1},\"singleton\":{\"description\":\"Allow only a single version of the shared module in share scope (disabled by default).\",\"type\":\"boolean\"},\"strictVersion\":{\"description\":\"Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).\",\"type\":\"boolean\"}}},\"ConsumesItem\":{\"description\":\"A module that should be consumed from share scope.\",\"type\":\"string\",\"minLength\":1},\"ConsumesObject\":{\"description\":\"Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be consumed from share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ConsumesConfig\"},{\"$ref\":\"#/definitions/ConsumesItem\"}]}}},\"title\":\"ConsumeSharedPluginOptions\",\"description\":\"Options for consuming shared modules.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"consumes\":{\"$ref\":\"#/definitions/Consumes\"},\"shareScope\":{\"description\":\"Share scope name used for all consumed modules (defaults to 'default').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"consumes\"]}"); /***/ }), /***/ 12287: /***/ (function(module) { "use strict"; module.exports = JSON.parse("{\"definitions\":{\"Provides\":{\"description\":\"Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be provided as shared modules to the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ProvidesItem\"},{\"$ref\":\"#/definitions/ProvidesObject\"}]}},{\"$ref\":\"#/definitions/ProvidesObject\"}]},\"ProvidesConfig\":{\"description\":\"Advanced configuration for modules that should be provided as shared modules to the share scope.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"eager\":{\"description\":\"Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.\",\"type\":\"boolean\"},\"shareKey\":{\"description\":\"Key in the share scope under which the shared modules should be stored.\",\"type\":\"string\",\"minLength\":1},\"shareScope\":{\"description\":\"Share scope name.\",\"type\":\"string\",\"minLength\":1},\"version\":{\"description\":\"Version of the provided module. Will replace lower matching versions, but not higher.\",\"anyOf\":[{\"description\":\"Don't provide a version.\",\"enum\":[false]},{\"description\":\"Version as string. Each part of the version should be separated by a dot '.'.\",\"type\":\"string\"}]}}},\"ProvidesItem\":{\"description\":\"Request to a module that should be provided as shared module to the share scope (will be resolved when relative).\",\"type\":\"string\",\"minLength\":1},\"ProvidesObject\":{\"description\":\"Modules that should be provided as shared modules to the share scope. Property names are used as share keys.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be provided as shared modules to the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ProvidesConfig\"},{\"$ref\":\"#/definitions/ProvidesItem\"}]}}},\"title\":\"ProvideSharedPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"provides\":{\"$ref\":\"#/definitions/Provides\"},\"shareScope\":{\"description\":\"Share scope name used for all provided modules (defaults to 'default').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"provides\"]}"); /***/ }), /***/ 95373: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cloneNode = cloneNode; function cloneNode(n) { return Object.assign({}, n); } /***/ }), /***/ 98688: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = { numberLiteralFromRaw: true, withLoc: true, withRaw: true, funcParam: true, indexLiteral: true, memIndexLiteral: true, instruction: true, objectInstruction: true, traverse: true, signatures: true, cloneNode: true, moduleContextFromModuleAST: true }; Object.defineProperty(exports, "numberLiteralFromRaw", ({ enumerable: true, get: function get() { return _nodeHelpers.numberLiteralFromRaw; } })); Object.defineProperty(exports, "withLoc", ({ enumerable: true, get: function get() { return _nodeHelpers.withLoc; } })); Object.defineProperty(exports, "withRaw", ({ enumerable: true, get: function get() { return _nodeHelpers.withRaw; } })); Object.defineProperty(exports, "funcParam", ({ enumerable: true, get: function get() { return _nodeHelpers.funcParam; } })); Object.defineProperty(exports, "indexLiteral", ({ enumerable: true, get: function get() { return _nodeHelpers.indexLiteral; } })); Object.defineProperty(exports, "memIndexLiteral", ({ enumerable: true, get: function get() { return _nodeHelpers.memIndexLiteral; } })); Object.defineProperty(exports, "instruction", ({ enumerable: true, get: function get() { return _nodeHelpers.instruction; } })); Object.defineProperty(exports, "objectInstruction", ({ enumerable: true, get: function get() { return _nodeHelpers.objectInstruction; } })); Object.defineProperty(exports, "traverse", ({ enumerable: true, get: function get() { return _traverse.traverse; } })); Object.defineProperty(exports, "signatures", ({ enumerable: true, get: function get() { return _signatures.signatures; } })); Object.defineProperty(exports, "cloneNode", ({ enumerable: true, get: function get() { return _clone.cloneNode; } })); Object.defineProperty(exports, "moduleContextFromModuleAST", ({ enumerable: true, get: function get() { return _astModuleToModuleContext.moduleContextFromModuleAST; } })); var _nodes = __webpack_require__(36588); Object.keys(_nodes).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _nodes[key]; } }); }); var _nodeHelpers = __webpack_require__(69887); var _traverse = __webpack_require__(34390); var _signatures = __webpack_require__(14004); var _utils = __webpack_require__(26038); Object.keys(_utils).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _utils[key]; } }); }); var _clone = __webpack_require__(95373); var _astModuleToModuleContext = __webpack_require__(52018); /***/ }), /***/ 69887: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.numberLiteralFromRaw = numberLiteralFromRaw; exports.instruction = instruction; exports.objectInstruction = objectInstruction; exports.withLoc = withLoc; exports.withRaw = withRaw; exports.funcParam = funcParam; exports.indexLiteral = indexLiteral; exports.memIndexLiteral = memIndexLiteral; var _helperNumbers = __webpack_require__(27716); var _nodes = __webpack_require__(36588); function numberLiteralFromRaw(rawValue) { var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32"; var original = rawValue; // Remove numeric separators _ if (typeof rawValue === "string") { rawValue = rawValue.replace(/_/g, ""); } if (typeof rawValue === "number") { return (0, _nodes.numberLiteral)(rawValue, String(original)); } else { switch (instructionType) { case "i32": { return (0, _nodes.numberLiteral)((0, _helperNumbers.parse32I)(rawValue), String(original)); } case "u32": { return (0, _nodes.numberLiteral)((0, _helperNumbers.parseU32)(rawValue), String(original)); } case "i64": { return (0, _nodes.longNumberLiteral)((0, _helperNumbers.parse64I)(rawValue), String(original)); } case "f32": { return (0, _nodes.floatLiteral)((0, _helperNumbers.parse32F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original)); } // f64 default: { return (0, _nodes.floatLiteral)((0, _helperNumbers.parse64F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original)); } } } } function instruction(id) { var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return (0, _nodes.instr)(id, undefined, args, namedArgs); } function objectInstruction(id, object) { var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; return (0, _nodes.instr)(id, object, args, namedArgs); } /** * Decorators */ function withLoc(n, end, start) { var loc = { start: start, end: end }; n.loc = loc; return n; } function withRaw(n, raw) { n.raw = raw; return n; } function funcParam(valtype, id) { return { id: id, valtype: valtype }; } function indexLiteral(value) { // $FlowIgnore var x = numberLiteralFromRaw(value, "u32"); return x; } function memIndexLiteral(value) { // $FlowIgnore var x = numberLiteralFromRaw(value, "u32"); return x; } /***/ }), /***/ 27110: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createPath = createPath; function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function findParent(_ref, cb) { var parentPath = _ref.parentPath; if (parentPath == null) { throw new Error("node is root"); } var currentPath = parentPath; while (cb(currentPath) !== false) { // Hit the root node, stop // $FlowIgnore if (currentPath.parentPath == null) { return null; } // $FlowIgnore currentPath = currentPath.parentPath; } return currentPath.node; } function insertBefore(context, newNode) { return insert(context, newNode); } function insertAfter(context, newNode) { return insert(context, newNode, 1); } function insert(_ref2, newNode) { var node = _ref2.node, inList = _ref2.inList, parentPath = _ref2.parentPath, parentKey = _ref2.parentKey; var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; if (!inList) { throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || 0)); } if (!(parentPath != null)) { throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || 0)); } // $FlowIgnore var parentList = parentPath.node[parentKey]; var indexInList = parentList.findIndex(function (n) { return n === node; }); parentList.splice(indexInList + indexOffset, 0, newNode); } function remove(_ref3) { var node = _ref3.node, parentKey = _ref3.parentKey, parentPath = _ref3.parentPath; if (!(parentPath != null)) { throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || 0)); } // $FlowIgnore var parentNode = parentPath.node; // $FlowIgnore var parentProperty = parentNode[parentKey]; if (Array.isArray(parentProperty)) { // $FlowIgnore parentNode[parentKey] = parentProperty.filter(function (n) { return n !== node; }); } else { // $FlowIgnore delete parentNode[parentKey]; } node._deleted = true; } function stop(context) { context.shouldStop = true; } function replaceWith(context, newNode) { // $FlowIgnore var parentNode = context.parentPath.node; // $FlowIgnore var parentProperty = parentNode[context.parentKey]; if (Array.isArray(parentProperty)) { var indexInList = parentProperty.findIndex(function (n) { return n === context.node; }); parentProperty.splice(indexInList, 1, newNode); } else { // $FlowIgnore parentNode[context.parentKey] = newNode; } context.node._deleted = true; context.node = newNode; } // bind the context to the first argument of node operations function bindNodeOperations(operations, context) { var keys = Object.keys(operations); var boundOperations = {}; keys.forEach(function (key) { boundOperations[key] = operations[key].bind(null, context); }); return boundOperations; } function createPathOperations(context) { // $FlowIgnore return bindNodeOperations({ findParent: findParent, replaceWith: replaceWith, remove: remove, insertBefore: insertBefore, insertAfter: insertAfter, stop: stop }, context); } function createPath(context) { var path = _extends({}, context); // $FlowIgnore Object.assign(path, createPathOperations(path)); // $FlowIgnore return path; } /***/ }), /***/ 36588: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.module = _module; exports.moduleMetadata = moduleMetadata; exports.moduleNameMetadata = moduleNameMetadata; exports.functionNameMetadata = functionNameMetadata; exports.localNameMetadata = localNameMetadata; exports.binaryModule = binaryModule; exports.quoteModule = quoteModule; exports.sectionMetadata = sectionMetadata; exports.producersSectionMetadata = producersSectionMetadata; exports.producerMetadata = producerMetadata; exports.producerMetadataVersionedName = producerMetadataVersionedName; exports.loopInstruction = loopInstruction; exports.instr = instr; exports.ifInstruction = ifInstruction; exports.stringLiteral = stringLiteral; exports.numberLiteral = numberLiteral; exports.longNumberLiteral = longNumberLiteral; exports.floatLiteral = floatLiteral; exports.elem = elem; exports.indexInFuncSection = indexInFuncSection; exports.valtypeLiteral = valtypeLiteral; exports.typeInstruction = typeInstruction; exports.start = start; exports.globalType = globalType; exports.leadingComment = leadingComment; exports.blockComment = blockComment; exports.data = data; exports.global = global; exports.table = table; exports.memory = memory; exports.funcImportDescr = funcImportDescr; exports.moduleImport = moduleImport; exports.moduleExportDescr = moduleExportDescr; exports.moduleExport = moduleExport; exports.limit = limit; exports.signature = signature; exports.program = program; exports.identifier = identifier; exports.blockInstruction = blockInstruction; exports.callInstruction = callInstruction; exports.callIndirectInstruction = callIndirectInstruction; exports.byteArray = byteArray; exports.func = func; exports.internalBrUnless = internalBrUnless; exports.internalGoto = internalGoto; exports.internalCallExtern = internalCallExtern; exports.internalEndAndReturn = internalEndAndReturn; exports.assertInternalCallExtern = exports.assertInternalGoto = exports.assertInternalBrUnless = exports.assertFunc = exports.assertByteArray = exports.assertCallIndirectInstruction = exports.assertCallInstruction = exports.assertBlockInstruction = exports.assertIdentifier = exports.assertProgram = exports.assertSignature = exports.assertLimit = exports.assertModuleExport = exports.assertModuleExportDescr = exports.assertModuleImport = exports.assertFuncImportDescr = exports.assertMemory = exports.assertTable = exports.assertGlobal = exports.assertData = exports.assertBlockComment = exports.assertLeadingComment = exports.assertGlobalType = exports.assertStart = exports.assertTypeInstruction = exports.assertValtypeLiteral = exports.assertIndexInFuncSection = exports.assertElem = exports.assertFloatLiteral = exports.assertLongNumberLiteral = exports.assertNumberLiteral = exports.assertStringLiteral = exports.assertIfInstruction = exports.assertInstr = exports.assertLoopInstruction = exports.assertProducerMetadataVersionedName = exports.assertProducerMetadata = exports.assertProducersSectionMetadata = exports.assertSectionMetadata = exports.assertQuoteModule = exports.assertBinaryModule = exports.assertLocalNameMetadata = exports.assertFunctionNameMetadata = exports.assertModuleNameMetadata = exports.assertModuleMetadata = exports.assertModule = exports.isIntrinsic = exports.isImportDescr = exports.isNumericLiteral = exports.isExpression = exports.isInstruction = exports.isBlock = exports.isNode = exports.isInternalEndAndReturn = exports.isInternalCallExtern = exports.isInternalGoto = exports.isInternalBrUnless = exports.isFunc = exports.isByteArray = exports.isCallIndirectInstruction = exports.isCallInstruction = exports.isBlockInstruction = exports.isIdentifier = exports.isProgram = exports.isSignature = exports.isLimit = exports.isModuleExport = exports.isModuleExportDescr = exports.isModuleImport = exports.isFuncImportDescr = exports.isMemory = exports.isTable = exports.isGlobal = exports.isData = exports.isBlockComment = exports.isLeadingComment = exports.isGlobalType = exports.isStart = exports.isTypeInstruction = exports.isValtypeLiteral = exports.isIndexInFuncSection = exports.isElem = exports.isFloatLiteral = exports.isLongNumberLiteral = exports.isNumberLiteral = exports.isStringLiteral = exports.isIfInstruction = exports.isInstr = exports.isLoopInstruction = exports.isProducerMetadataVersionedName = exports.isProducerMetadata = exports.isProducersSectionMetadata = exports.isSectionMetadata = exports.isQuoteModule = exports.isBinaryModule = exports.isLocalNameMetadata = exports.isFunctionNameMetadata = exports.isModuleNameMetadata = exports.isModuleMetadata = exports.isModule = void 0; exports.nodeAndUnionTypes = exports.unionTypesMap = exports.assertInternalEndAndReturn = void 0; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } // THIS FILE IS AUTOGENERATED // see scripts/generateNodeUtils.js function isTypeOf(t) { return function (n) { return n.type === t; }; } function assertTypeOf(t) { return function (n) { return function () { if (!(n.type === t)) { throw new Error('n.type === t' + " error: " + (undefined || "unknown")); } }(); }; } function _module(id, fields, metadata) { if (id !== null && id !== undefined) { if (!(typeof id === "string")) { throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || 0)); } } if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) { throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Module", id: id, fields: fields }; if (typeof metadata !== "undefined") { node.metadata = metadata; } return node; } function moduleMetadata(sections, functionNames, localNames, producers) { if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) { throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (functionNames !== null && functionNames !== undefined) { if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) { throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown")); } } if (localNames !== null && localNames !== undefined) { if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) { throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown")); } } if (producers !== null && producers !== undefined) { if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); } } var node = { type: "ModuleMetadata", sections: sections }; if (typeof functionNames !== "undefined" && functionNames.length > 0) { node.functionNames = functionNames; } if (typeof localNames !== "undefined" && localNames.length > 0) { node.localNames = localNames; } if (typeof producers !== "undefined" && producers.length > 0) { node.producers = producers; } return node; } function moduleNameMetadata(value) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } var node = { type: "ModuleNameMetadata", value: value }; return node; } function functionNameMetadata(value, index) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } if (!(typeof index === "number")) { throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || 0)); } var node = { type: "FunctionNameMetadata", value: value, index: index }; return node; } function localNameMetadata(value, localIndex, functionIndex) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } if (!(typeof localIndex === "number")) { throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || 0)); } if (!(typeof functionIndex === "number")) { throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || 0)); } var node = { type: "LocalNameMetadata", value: value, localIndex: localIndex, functionIndex: functionIndex }; return node; } function binaryModule(id, blob) { if (id !== null && id !== undefined) { if (!(typeof id === "string")) { throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || 0)); } } if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) { throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "BinaryModule", id: id, blob: blob }; return node; } function quoteModule(id, string) { if (id !== null && id !== undefined) { if (!(typeof id === "string")) { throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || 0)); } } if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) { throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "QuoteModule", id: id, string: string }; return node; } function sectionMetadata(section, startOffset, size, vectorOfSize) { if (!(typeof startOffset === "number")) { throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || 0)); } var node = { type: "SectionMetadata", section: section, startOffset: startOffset, size: size, vectorOfSize: vectorOfSize }; return node; } function producersSectionMetadata(producers) { if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) { throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "ProducersSectionMetadata", producers: producers }; return node; } function producerMetadata(language, processedBy, sdk) { if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) { throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) { throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) { throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "ProducerMetadata", language: language, processedBy: processedBy, sdk: sdk }; return node; } function producerMetadataVersionedName(name, version) { if (!(typeof name === "string")) { throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || 0)); } if (!(typeof version === "string")) { throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || 0)); } var node = { type: "ProducerMetadataVersionedName", name: name, version: version }; return node; } function loopInstruction(label, resulttype, instr) { if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "LoopInstruction", id: "loop", label: label, resulttype: resulttype, instr: instr }; return node; } function instr(id, object, args, namedArgs) { if (!(typeof id === "string")) { throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || 0)); } if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) { throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Instr", id: id, args: args }; if (typeof object !== "undefined") { node.object = object; } if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) { node.namedArgs = namedArgs; } return node; } function ifInstruction(testLabel, test, result, consequent, alternate) { if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) { throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) { throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) { throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "IfInstruction", id: "if", testLabel: testLabel, test: test, result: result, consequent: consequent, alternate: alternate }; return node; } function stringLiteral(value) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } var node = { type: "StringLiteral", value: value }; return node; } function numberLiteral(value, raw) { if (!(typeof value === "number")) { throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || 0)); } if (!(typeof raw === "string")) { throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || 0)); } var node = { type: "NumberLiteral", value: value, raw: raw }; return node; } function longNumberLiteral(value, raw) { if (!(typeof raw === "string")) { throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || 0)); } var node = { type: "LongNumberLiteral", value: value, raw: raw }; return node; } function floatLiteral(value, nan, inf, raw) { if (!(typeof value === "number")) { throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || 0)); } if (nan !== null && nan !== undefined) { if (!(typeof nan === "boolean")) { throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || 0)); } } if (inf !== null && inf !== undefined) { if (!(typeof inf === "boolean")) { throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || 0)); } } if (!(typeof raw === "string")) { throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || 0)); } var node = { type: "FloatLiteral", value: value, raw: raw }; if (nan === true) { node.nan = true; } if (inf === true) { node.inf = true; } return node; } function elem(table, offset, funcs) { if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) { throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) { throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Elem", table: table, offset: offset, funcs: funcs }; return node; } function indexInFuncSection(index) { var node = { type: "IndexInFuncSection", index: index }; return node; } function valtypeLiteral(name) { var node = { type: "ValtypeLiteral", name: name }; return node; } function typeInstruction(id, functype) { var node = { type: "TypeInstruction", id: id, functype: functype }; return node; } function start(index) { var node = { type: "Start", index: index }; return node; } function globalType(valtype, mutability) { var node = { type: "GlobalType", valtype: valtype, mutability: mutability }; return node; } function leadingComment(value) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } var node = { type: "LeadingComment", value: value }; return node; } function blockComment(value) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } var node = { type: "BlockComment", value: value }; return node; } function data(memoryIndex, offset, init) { var node = { type: "Data", memoryIndex: memoryIndex, offset: offset, init: init }; return node; } function global(globalType, init, name) { if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) { throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Global", globalType: globalType, init: init, name: name }; return node; } function table(elementType, limits, name, elements) { if (!(limits.type === "Limit")) { throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || 0)); } if (elements !== null && elements !== undefined) { if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) { throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown")); } } var node = { type: "Table", elementType: elementType, limits: limits, name: name }; if (typeof elements !== "undefined" && elements.length > 0) { node.elements = elements; } return node; } function memory(limits, id) { var node = { type: "Memory", limits: limits, id: id }; return node; } function funcImportDescr(id, signature) { var node = { type: "FuncImportDescr", id: id, signature: signature }; return node; } function moduleImport(module, name, descr) { if (!(typeof module === "string")) { throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || 0)); } if (!(typeof name === "string")) { throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || 0)); } var node = { type: "ModuleImport", module: module, name: name, descr: descr }; return node; } function moduleExportDescr(exportType, id) { var node = { type: "ModuleExportDescr", exportType: exportType, id: id }; return node; } function moduleExport(name, descr) { if (!(typeof name === "string")) { throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || 0)); } var node = { type: "ModuleExport", name: name, descr: descr }; return node; } function limit(min, max, shared) { if (!(typeof min === "number")) { throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || 0)); } if (max !== null && max !== undefined) { if (!(typeof max === "number")) { throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || 0)); } } if (shared !== null && shared !== undefined) { if (!(typeof shared === "boolean")) { throw new Error('typeof shared === "boolean"' + " error: " + ("Argument shared must be of type boolean, given: " + _typeof(shared) || 0)); } } var node = { type: "Limit", min: min }; if (typeof max !== "undefined") { node.max = max; } if (shared === true) { node.shared = true; } return node; } function signature(params, results) { if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) { throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) { throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Signature", params: params, results: results }; return node; } function program(body) { if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "Program", body: body }; return node; } function identifier(value, raw) { if (!(typeof value === "string")) { throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || 0)); } if (raw !== null && raw !== undefined) { if (!(typeof raw === "string")) { throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || 0)); } } var node = { type: "Identifier", value: value }; if (typeof raw !== "undefined") { node.raw = raw; } return node; } function blockInstruction(label, instr, result) { if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) { throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "BlockInstruction", id: "block", label: label, instr: instr, result: result }; return node; } function callInstruction(index, instrArgs, numeric) { if (instrArgs !== null && instrArgs !== undefined) { if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) { throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown")); } } var node = { type: "CallInstruction", id: "call", index: index }; if (typeof instrArgs !== "undefined" && instrArgs.length > 0) { node.instrArgs = instrArgs; } if (typeof numeric !== "undefined") { node.numeric = numeric; } return node; } function callIndirectInstruction(signature, intrs) { if (intrs !== null && intrs !== undefined) { if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) { throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown")); } } var node = { type: "CallIndirectInstruction", id: "call_indirect", signature: signature }; if (typeof intrs !== "undefined" && intrs.length > 0) { node.intrs = intrs; } return node; } function byteArray(values) { if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) { throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown")); } var node = { type: "ByteArray", values: values }; return node; } function func(name, signature, body, isExternal, metadata) { if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) { throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown")); } if (isExternal !== null && isExternal !== undefined) { if (!(typeof isExternal === "boolean")) { throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || 0)); } } var node = { type: "Func", name: name, signature: signature, body: body }; if (isExternal === true) { node.isExternal = true; } if (typeof metadata !== "undefined") { node.metadata = metadata; } return node; } function internalBrUnless(target) { if (!(typeof target === "number")) { throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || 0)); } var node = { type: "InternalBrUnless", target: target }; return node; } function internalGoto(target) { if (!(typeof target === "number")) { throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || 0)); } var node = { type: "InternalGoto", target: target }; return node; } function internalCallExtern(target) { if (!(typeof target === "number")) { throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || 0)); } var node = { type: "InternalCallExtern", target: target }; return node; } function internalEndAndReturn() { var node = { type: "InternalEndAndReturn" }; return node; } var isModule = isTypeOf("Module"); exports.isModule = isModule; var isModuleMetadata = isTypeOf("ModuleMetadata"); exports.isModuleMetadata = isModuleMetadata; var isModuleNameMetadata = isTypeOf("ModuleNameMetadata"); exports.isModuleNameMetadata = isModuleNameMetadata; var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata"); exports.isFunctionNameMetadata = isFunctionNameMetadata; var isLocalNameMetadata = isTypeOf("LocalNameMetadata"); exports.isLocalNameMetadata = isLocalNameMetadata; var isBinaryModule = isTypeOf("BinaryModule"); exports.isBinaryModule = isBinaryModule; var isQuoteModule = isTypeOf("QuoteModule"); exports.isQuoteModule = isQuoteModule; var isSectionMetadata = isTypeOf("SectionMetadata"); exports.isSectionMetadata = isSectionMetadata; var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata"); exports.isProducersSectionMetadata = isProducersSectionMetadata; var isProducerMetadata = isTypeOf("ProducerMetadata"); exports.isProducerMetadata = isProducerMetadata; var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName"); exports.isProducerMetadataVersionedName = isProducerMetadataVersionedName; var isLoopInstruction = isTypeOf("LoopInstruction"); exports.isLoopInstruction = isLoopInstruction; var isInstr = isTypeOf("Instr"); exports.isInstr = isInstr; var isIfInstruction = isTypeOf("IfInstruction"); exports.isIfInstruction = isIfInstruction; var isStringLiteral = isTypeOf("StringLiteral"); exports.isStringLiteral = isStringLiteral; var isNumberLiteral = isTypeOf("NumberLiteral"); exports.isNumberLiteral = isNumberLiteral; var isLongNumberLiteral = isTypeOf("LongNumberLiteral"); exports.isLongNumberLiteral = isLongNumberLiteral; var isFloatLiteral = isTypeOf("FloatLiteral"); exports.isFloatLiteral = isFloatLiteral; var isElem = isTypeOf("Elem"); exports.isElem = isElem; var isIndexInFuncSection = isTypeOf("IndexInFuncSection"); exports.isIndexInFuncSection = isIndexInFuncSection; var isValtypeLiteral = isTypeOf("ValtypeLiteral"); exports.isValtypeLiteral = isValtypeLiteral; var isTypeInstruction = isTypeOf("TypeInstruction"); exports.isTypeInstruction = isTypeInstruction; var isStart = isTypeOf("Start"); exports.isStart = isStart; var isGlobalType = isTypeOf("GlobalType"); exports.isGlobalType = isGlobalType; var isLeadingComment = isTypeOf("LeadingComment"); exports.isLeadingComment = isLeadingComment; var isBlockComment = isTypeOf("BlockComment"); exports.isBlockComment = isBlockComment; var isData = isTypeOf("Data"); exports.isData = isData; var isGlobal = isTypeOf("Global"); exports.isGlobal = isGlobal; var isTable = isTypeOf("Table"); exports.isTable = isTable; var isMemory = isTypeOf("Memory"); exports.isMemory = isMemory; var isFuncImportDescr = isTypeOf("FuncImportDescr"); exports.isFuncImportDescr = isFuncImportDescr; var isModuleImport = isTypeOf("ModuleImport"); exports.isModuleImport = isModuleImport; var isModuleExportDescr = isTypeOf("ModuleExportDescr"); exports.isModuleExportDescr = isModuleExportDescr; var isModuleExport = isTypeOf("ModuleExport"); exports.isModuleExport = isModuleExport; var isLimit = isTypeOf("Limit"); exports.isLimit = isLimit; var isSignature = isTypeOf("Signature"); exports.isSignature = isSignature; var isProgram = isTypeOf("Program"); exports.isProgram = isProgram; var isIdentifier = isTypeOf("Identifier"); exports.isIdentifier = isIdentifier; var isBlockInstruction = isTypeOf("BlockInstruction"); exports.isBlockInstruction = isBlockInstruction; var isCallInstruction = isTypeOf("CallInstruction"); exports.isCallInstruction = isCallInstruction; var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction"); exports.isCallIndirectInstruction = isCallIndirectInstruction; var isByteArray = isTypeOf("ByteArray"); exports.isByteArray = isByteArray; var isFunc = isTypeOf("Func"); exports.isFunc = isFunc; var isInternalBrUnless = isTypeOf("InternalBrUnless"); exports.isInternalBrUnless = isInternalBrUnless; var isInternalGoto = isTypeOf("InternalGoto"); exports.isInternalGoto = isInternalGoto; var isInternalCallExtern = isTypeOf("InternalCallExtern"); exports.isInternalCallExtern = isInternalCallExtern; var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn"); exports.isInternalEndAndReturn = isInternalEndAndReturn; var isNode = function isNode(node) { return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); }; exports.isNode = isNode; var isBlock = function isBlock(node) { return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node); }; exports.isBlock = isBlock; var isInstruction = function isInstruction(node) { return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node); }; exports.isInstruction = isInstruction; var isExpression = function isExpression(node) { return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node); }; exports.isExpression = isExpression; var isNumericLiteral = function isNumericLiteral(node) { return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node); }; exports.isNumericLiteral = isNumericLiteral; var isImportDescr = function isImportDescr(node) { return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node); }; exports.isImportDescr = isImportDescr; var isIntrinsic = function isIntrinsic(node) { return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node); }; exports.isIntrinsic = isIntrinsic; var assertModule = assertTypeOf("Module"); exports.assertModule = assertModule; var assertModuleMetadata = assertTypeOf("ModuleMetadata"); exports.assertModuleMetadata = assertModuleMetadata; var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata"); exports.assertModuleNameMetadata = assertModuleNameMetadata; var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata"); exports.assertFunctionNameMetadata = assertFunctionNameMetadata; var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata"); exports.assertLocalNameMetadata = assertLocalNameMetadata; var assertBinaryModule = assertTypeOf("BinaryModule"); exports.assertBinaryModule = assertBinaryModule; var assertQuoteModule = assertTypeOf("QuoteModule"); exports.assertQuoteModule = assertQuoteModule; var assertSectionMetadata = assertTypeOf("SectionMetadata"); exports.assertSectionMetadata = assertSectionMetadata; var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata"); exports.assertProducersSectionMetadata = assertProducersSectionMetadata; var assertProducerMetadata = assertTypeOf("ProducerMetadata"); exports.assertProducerMetadata = assertProducerMetadata; var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName"); exports.assertProducerMetadataVersionedName = assertProducerMetadataVersionedName; var assertLoopInstruction = assertTypeOf("LoopInstruction"); exports.assertLoopInstruction = assertLoopInstruction; var assertInstr = assertTypeOf("Instr"); exports.assertInstr = assertInstr; var assertIfInstruction = assertTypeOf("IfInstruction"); exports.assertIfInstruction = assertIfInstruction; var assertStringLiteral = assertTypeOf("StringLiteral"); exports.assertStringLiteral = assertStringLiteral; var assertNumberLiteral = assertTypeOf("NumberLiteral"); exports.assertNumberLiteral = assertNumberLiteral; var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral"); exports.assertLongNumberLiteral = assertLongNumberLiteral; var assertFloatLiteral = assertTypeOf("FloatLiteral"); exports.assertFloatLiteral = assertFloatLiteral; var assertElem = assertTypeOf("Elem"); exports.assertElem = assertElem; var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection"); exports.assertIndexInFuncSection = assertIndexInFuncSection; var assertValtypeLiteral = assertTypeOf("ValtypeLiteral"); exports.assertValtypeLiteral = assertValtypeLiteral; var assertTypeInstruction = assertTypeOf("TypeInstruction"); exports.assertTypeInstruction = assertTypeInstruction; var assertStart = assertTypeOf("Start"); exports.assertStart = assertStart; var assertGlobalType = assertTypeOf("GlobalType"); exports.assertGlobalType = assertGlobalType; var assertLeadingComment = assertTypeOf("LeadingComment"); exports.assertLeadingComment = assertLeadingComment; var assertBlockComment = assertTypeOf("BlockComment"); exports.assertBlockComment = assertBlockComment; var assertData = assertTypeOf("Data"); exports.assertData = assertData; var assertGlobal = assertTypeOf("Global"); exports.assertGlobal = assertGlobal; var assertTable = assertTypeOf("Table"); exports.assertTable = assertTable; var assertMemory = assertTypeOf("Memory"); exports.assertMemory = assertMemory; var assertFuncImportDescr = assertTypeOf("FuncImportDescr"); exports.assertFuncImportDescr = assertFuncImportDescr; var assertModuleImport = assertTypeOf("ModuleImport"); exports.assertModuleImport = assertModuleImport; var assertModuleExportDescr = assertTypeOf("ModuleExportDescr"); exports.assertModuleExportDescr = assertModuleExportDescr; var assertModuleExport = assertTypeOf("ModuleExport"); exports.assertModuleExport = assertModuleExport; var assertLimit = assertTypeOf("Limit"); exports.assertLimit = assertLimit; var assertSignature = assertTypeOf("Signature"); exports.assertSignature = assertSignature; var assertProgram = assertTypeOf("Program"); exports.assertProgram = assertProgram; var assertIdentifier = assertTypeOf("Identifier"); exports.assertIdentifier = assertIdentifier; var assertBlockInstruction = assertTypeOf("BlockInstruction"); exports.assertBlockInstruction = assertBlockInstruction; var assertCallInstruction = assertTypeOf("CallInstruction"); exports.assertCallInstruction = assertCallInstruction; var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction"); exports.assertCallIndirectInstruction = assertCallIndirectInstruction; var assertByteArray = assertTypeOf("ByteArray"); exports.assertByteArray = assertByteArray; var assertFunc = assertTypeOf("Func"); exports.assertFunc = assertFunc; var assertInternalBrUnless = assertTypeOf("InternalBrUnless"); exports.assertInternalBrUnless = assertInternalBrUnless; var assertInternalGoto = assertTypeOf("InternalGoto"); exports.assertInternalGoto = assertInternalGoto; var assertInternalCallExtern = assertTypeOf("InternalCallExtern"); exports.assertInternalCallExtern = assertInternalCallExtern; var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn"); exports.assertInternalEndAndReturn = assertInternalEndAndReturn; var unionTypesMap = { Module: ["Node"], ModuleMetadata: ["Node"], ModuleNameMetadata: ["Node"], FunctionNameMetadata: ["Node"], LocalNameMetadata: ["Node"], BinaryModule: ["Node"], QuoteModule: ["Node"], SectionMetadata: ["Node"], ProducersSectionMetadata: ["Node"], ProducerMetadata: ["Node"], ProducerMetadataVersionedName: ["Node"], LoopInstruction: ["Node", "Block", "Instruction"], Instr: ["Node", "Expression", "Instruction"], IfInstruction: ["Node", "Instruction"], StringLiteral: ["Node", "Expression"], NumberLiteral: ["Node", "NumericLiteral", "Expression"], LongNumberLiteral: ["Node", "NumericLiteral", "Expression"], FloatLiteral: ["Node", "NumericLiteral", "Expression"], Elem: ["Node"], IndexInFuncSection: ["Node"], ValtypeLiteral: ["Node", "Expression"], TypeInstruction: ["Node", "Instruction"], Start: ["Node"], GlobalType: ["Node", "ImportDescr"], LeadingComment: ["Node"], BlockComment: ["Node"], Data: ["Node"], Global: ["Node"], Table: ["Node", "ImportDescr"], Memory: ["Node", "ImportDescr"], FuncImportDescr: ["Node", "ImportDescr"], ModuleImport: ["Node"], ModuleExportDescr: ["Node"], ModuleExport: ["Node"], Limit: ["Node"], Signature: ["Node"], Program: ["Node"], Identifier: ["Node", "Expression"], BlockInstruction: ["Node", "Block", "Instruction"], CallInstruction: ["Node", "Instruction"], CallIndirectInstruction: ["Node", "Instruction"], ByteArray: ["Node"], Func: ["Node", "Block"], InternalBrUnless: ["Node", "Intrinsic"], InternalGoto: ["Node", "Intrinsic"], InternalCallExtern: ["Node", "Intrinsic"], InternalEndAndReturn: ["Node", "Intrinsic"] }; exports.unionTypesMap = unionTypesMap; var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"]; exports.nodeAndUnionTypes = nodeAndUnionTypes; /***/ }), /***/ 14004: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.signatures = void 0; function sign(input, output) { return [input, output]; } var u32 = "u32"; var i32 = "i32"; var i64 = "i64"; var f32 = "f32"; var f64 = "f64"; var vector = function vector(t) { var vecType = [t]; // $FlowIgnore vecType.vector = true; return vecType; }; var controlInstructions = { unreachable: sign([], []), nop: sign([], []), // block ? // loop ? // if ? // if else ? br: sign([u32], []), br_if: sign([u32], []), br_table: sign(vector(u32), []), return: sign([], []), call: sign([u32], []), call_indirect: sign([u32], []) }; var parametricInstructions = { drop: sign([], []), select: sign([], []) }; var variableInstructions = { get_local: sign([u32], []), set_local: sign([u32], []), tee_local: sign([u32], []), get_global: sign([u32], []), set_global: sign([u32], []) }; var memoryInstructions = { "i32.load": sign([u32, u32], [i32]), "i64.load": sign([u32, u32], []), "f32.load": sign([u32, u32], []), "f64.load": sign([u32, u32], []), "i32.load8_s": sign([u32, u32], [i32]), "i32.load8_u": sign([u32, u32], [i32]), "i32.load16_s": sign([u32, u32], [i32]), "i32.load16_u": sign([u32, u32], [i32]), "i64.load8_s": sign([u32, u32], [i64]), "i64.load8_u": sign([u32, u32], [i64]), "i64.load16_s": sign([u32, u32], [i64]), "i64.load16_u": sign([u32, u32], [i64]), "i64.load32_s": sign([u32, u32], [i64]), "i64.load32_u": sign([u32, u32], [i64]), "i32.store": sign([u32, u32], []), "i64.store": sign([u32, u32], []), "f32.store": sign([u32, u32], []), "f64.store": sign([u32, u32], []), "i32.store8": sign([u32, u32], []), "i32.store16": sign([u32, u32], []), "i64.store8": sign([u32, u32], []), "i64.store16": sign([u32, u32], []), "i64.store32": sign([u32, u32], []), current_memory: sign([], []), grow_memory: sign([], []) }; var numericInstructions = { "i32.const": sign([i32], [i32]), "i64.const": sign([i64], [i64]), "f32.const": sign([f32], [f32]), "f64.const": sign([f64], [f64]), "i32.eqz": sign([i32], [i32]), "i32.eq": sign([i32, i32], [i32]), "i32.ne": sign([i32, i32], [i32]), "i32.lt_s": sign([i32, i32], [i32]), "i32.lt_u": sign([i32, i32], [i32]), "i32.gt_s": sign([i32, i32], [i32]), "i32.gt_u": sign([i32, i32], [i32]), "i32.le_s": sign([i32, i32], [i32]), "i32.le_u": sign([i32, i32], [i32]), "i32.ge_s": sign([i32, i32], [i32]), "i32.ge_u": sign([i32, i32], [i32]), "i64.eqz": sign([i64], [i64]), "i64.eq": sign([i64, i64], [i32]), "i64.ne": sign([i64, i64], [i32]), "i64.lt_s": sign([i64, i64], [i32]), "i64.lt_u": sign([i64, i64], [i32]), "i64.gt_s": sign([i64, i64], [i32]), "i64.gt_u": sign([i64, i64], [i32]), "i64.le_s": sign([i64, i64], [i32]), "i64.le_u": sign([i64, i64], [i32]), "i64.ge_s": sign([i64, i64], [i32]), "i64.ge_u": sign([i64, i64], [i32]), "f32.eq": sign([f32, f32], [i32]), "f32.ne": sign([f32, f32], [i32]), "f32.lt": sign([f32, f32], [i32]), "f32.gt": sign([f32, f32], [i32]), "f32.le": sign([f32, f32], [i32]), "f32.ge": sign([f32, f32], [i32]), "f64.eq": sign([f64, f64], [i32]), "f64.ne": sign([f64, f64], [i32]), "f64.lt": sign([f64, f64], [i32]), "f64.gt": sign([f64, f64], [i32]), "f64.le": sign([f64, f64], [i32]), "f64.ge": sign([f64, f64], [i32]), "i32.clz": sign([i32], [i32]), "i32.ctz": sign([i32], [i32]), "i32.popcnt": sign([i32], [i32]), "i32.add": sign([i32, i32], [i32]), "i32.sub": sign([i32, i32], [i32]), "i32.mul": sign([i32, i32], [i32]), "i32.div_s": sign([i32, i32], [i32]), "i32.div_u": sign([i32, i32], [i32]), "i32.rem_s": sign([i32, i32], [i32]), "i32.rem_u": sign([i32, i32], [i32]), "i32.and": sign([i32, i32], [i32]), "i32.or": sign([i32, i32], [i32]), "i32.xor": sign([i32, i32], [i32]), "i32.shl": sign([i32, i32], [i32]), "i32.shr_s": sign([i32, i32], [i32]), "i32.shr_u": sign([i32, i32], [i32]), "i32.rotl": sign([i32, i32], [i32]), "i32.rotr": sign([i32, i32], [i32]), "i64.clz": sign([i64], [i64]), "i64.ctz": sign([i64], [i64]), "i64.popcnt": sign([i64], [i64]), "i64.add": sign([i64, i64], [i64]), "i64.sub": sign([i64, i64], [i64]), "i64.mul": sign([i64, i64], [i64]), "i64.div_s": sign([i64, i64], [i64]), "i64.div_u": sign([i64, i64], [i64]), "i64.rem_s": sign([i64, i64], [i64]), "i64.rem_u": sign([i64, i64], [i64]), "i64.and": sign([i64, i64], [i64]), "i64.or": sign([i64, i64], [i64]), "i64.xor": sign([i64, i64], [i64]), "i64.shl": sign([i64, i64], [i64]), "i64.shr_s": sign([i64, i64], [i64]), "i64.shr_u": sign([i64, i64], [i64]), "i64.rotl": sign([i64, i64], [i64]), "i64.rotr": sign([i64, i64], [i64]), "f32.abs": sign([f32], [f32]), "f32.neg": sign([f32], [f32]), "f32.ceil": sign([f32], [f32]), "f32.floor": sign([f32], [f32]), "f32.trunc": sign([f32], [f32]), "f32.nearest": sign([f32], [f32]), "f32.sqrt": sign([f32], [f32]), "f32.add": sign([f32, f32], [f32]), "f32.sub": sign([f32, f32], [f32]), "f32.mul": sign([f32, f32], [f32]), "f32.div": sign([f32, f32], [f32]), "f32.min": sign([f32, f32], [f32]), "f32.max": sign([f32, f32], [f32]), "f32.copysign": sign([f32, f32], [f32]), "f64.abs": sign([f64], [f64]), "f64.neg": sign([f64], [f64]), "f64.ceil": sign([f64], [f64]), "f64.floor": sign([f64], [f64]), "f64.trunc": sign([f64], [f64]), "f64.nearest": sign([f64], [f64]), "f64.sqrt": sign([f64], [f64]), "f64.add": sign([f64, f64], [f64]), "f64.sub": sign([f64, f64], [f64]), "f64.mul": sign([f64, f64], [f64]), "f64.div": sign([f64, f64], [f64]), "f64.min": sign([f64, f64], [f64]), "f64.max": sign([f64, f64], [f64]), "f64.copysign": sign([f64, f64], [f64]), "i32.wrap/i64": sign([i64], [i32]), "i32.trunc_s/f32": sign([f32], [i32]), "i32.trunc_u/f32": sign([f32], [i32]), "i32.trunc_s/f64": sign([f32], [i32]), "i32.trunc_u/f64": sign([f64], [i32]), "i64.extend_s/i32": sign([i32], [i64]), "i64.extend_u/i32": sign([i32], [i64]), "i64.trunc_s/f32": sign([f32], [i64]), "i64.trunc_u/f32": sign([f32], [i64]), "i64.trunc_s/f64": sign([f64], [i64]), "i64.trunc_u/f64": sign([f64], [i64]), "f32.convert_s/i32": sign([i32], [f32]), "f32.convert_u/i32": sign([i32], [f32]), "f32.convert_s/i64": sign([i64], [f32]), "f32.convert_u/i64": sign([i64], [f32]), "f32.demote/f64": sign([f64], [f32]), "f64.convert_s/i32": sign([i32], [f64]), "f64.convert_u/i32": sign([i32], [f64]), "f64.convert_s/i64": sign([i64], [f64]), "f64.convert_u/i64": sign([i64], [f64]), "f64.promote/f32": sign([f32], [f64]), "i32.reinterpret/f32": sign([f32], [i32]), "i64.reinterpret/f64": sign([f64], [i64]), "f32.reinterpret/i32": sign([i32], [f32]), "f64.reinterpret/i64": sign([i64], [f64]) }; var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions); exports.signatures = signatures; /***/ }), /***/ 52018: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.moduleContextFromModuleAST = moduleContextFromModuleAST; exports.ModuleContext = void 0; var _nodes = __webpack_require__(36588); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function moduleContextFromModuleAST(m) { var moduleContext = new ModuleContext(); if (!(m.type === "Module")) { throw new Error('m.type === "Module"' + " error: " + (undefined || "unknown")); } m.fields.forEach(function (field) { switch (field.type) { case "Start": { moduleContext.setStart(field.index); break; } case "TypeInstruction": { moduleContext.addType(field); break; } case "Func": { moduleContext.addFunction(field); break; } case "Global": { moduleContext.defineGlobal(field); break; } case "ModuleImport": { switch (field.descr.type) { case "GlobalType": { moduleContext.importGlobal(field.descr.valtype, field.descr.mutability); break; } case "Memory": { moduleContext.addMemory(field.descr.limits.min, field.descr.limits.max); break; } case "FuncImportDescr": { moduleContext.importFunction(field.descr); break; } case "Table": { // FIXME(sven): not implemented yet break; } default: throw new Error("Unsupported ModuleImport of type " + JSON.stringify(field.descr.type)); } break; } case "Memory": { moduleContext.addMemory(field.limits.min, field.limits.max); break; } } }); return moduleContext; } /** * Module context for type checking */ var ModuleContext = /*#__PURE__*/ function () { function ModuleContext() { _classCallCheck(this, ModuleContext); this.funcs = []; this.funcsOffsetByIdentifier = []; this.types = []; this.globals = []; this.globalsOffsetByIdentifier = []; this.mems = []; // Current stack frame this.locals = []; this.labels = []; this.return = []; this.debugName = "unknown"; this.start = null; } /** * Set start segment */ _createClass(ModuleContext, [{ key: "setStart", value: function setStart(index) { this.start = index.value; } /** * Get start function */ }, { key: "getStart", value: function getStart() { return this.start; } /** * Reset the active stack frame */ }, { key: "newContext", value: function newContext(debugName, expectedResult) { this.locals = []; this.labels = [expectedResult]; this.return = expectedResult; this.debugName = debugName; } /** * Functions */ }, { key: "addFunction", value: function addFunction(func /*: Func*/ ) { // eslint-disable-next-line prefer-const var _ref = func.signature || {}, _ref$params = _ref.params, args = _ref$params === void 0 ? [] : _ref$params, _ref$results = _ref.results, result = _ref$results === void 0 ? [] : _ref$results; args = args.map(function (arg) { return arg.valtype; }); this.funcs.push({ args: args, result: result }); if (typeof func.name !== "undefined") { this.funcsOffsetByIdentifier[func.name.value] = this.funcs.length - 1; } } }, { key: "importFunction", value: function importFunction(funcimport) { if ((0, _nodes.isSignature)(funcimport.signature)) { // eslint-disable-next-line prefer-const var _funcimport$signature = funcimport.signature, args = _funcimport$signature.params, result = _funcimport$signature.results; args = args.map(function (arg) { return arg.valtype; }); this.funcs.push({ args: args, result: result }); } else { if (!(0, _nodes.isNumberLiteral)(funcimport.signature)) { throw new Error('isNumberLiteral(funcimport.signature)' + " error: " + (undefined || "unknown")); } var typeId = funcimport.signature.value; if (!this.hasType(typeId)) { throw new Error('this.hasType(typeId)' + " error: " + (undefined || "unknown")); } var signature = this.getType(typeId); this.funcs.push({ args: signature.params.map(function (arg) { return arg.valtype; }), result: signature.results }); } if (typeof funcimport.id !== "undefined") { // imports are first, we can assume their index in the array this.funcsOffsetByIdentifier[funcimport.id.value] = this.funcs.length - 1; } } }, { key: "hasFunction", value: function hasFunction(index) { return typeof this.getFunction(index) !== "undefined"; } }, { key: "getFunction", value: function getFunction(index) { if (typeof index !== "number") { throw new Error("getFunction only supported for number index"); } return this.funcs[index]; } }, { key: "getFunctionOffsetByIdentifier", value: function getFunctionOffsetByIdentifier(name) { if (!(typeof name === "string")) { throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); } return this.funcsOffsetByIdentifier[name]; } /** * Labels */ }, { key: "addLabel", value: function addLabel(result) { this.labels.unshift(result); } }, { key: "hasLabel", value: function hasLabel(index) { return this.labels.length > index && index >= 0; } }, { key: "getLabel", value: function getLabel(index) { return this.labels[index]; } }, { key: "popLabel", value: function popLabel() { this.labels.shift(); } /** * Locals */ }, { key: "hasLocal", value: function hasLocal(index) { return typeof this.getLocal(index) !== "undefined"; } }, { key: "getLocal", value: function getLocal(index) { return this.locals[index]; } }, { key: "addLocal", value: function addLocal(type) { this.locals.push(type); } /** * Types */ }, { key: "addType", value: function addType(type) { if (!(type.functype.type === "Signature")) { throw new Error('type.functype.type === "Signature"' + " error: " + (undefined || "unknown")); } this.types.push(type.functype); } }, { key: "hasType", value: function hasType(index) { return this.types[index] !== undefined; } }, { key: "getType", value: function getType(index) { return this.types[index]; } /** * Globals */ }, { key: "hasGlobal", value: function hasGlobal(index) { return this.globals.length > index && index >= 0; } }, { key: "getGlobal", value: function getGlobal(index) { return this.globals[index].type; } }, { key: "getGlobalOffsetByIdentifier", value: function getGlobalOffsetByIdentifier(name) { if (!(typeof name === "string")) { throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); } return this.globalsOffsetByIdentifier[name]; } }, { key: "defineGlobal", value: function defineGlobal(global /*: Global*/ ) { var type = global.globalType.valtype; var mutability = global.globalType.mutability; this.globals.push({ type: type, mutability: mutability }); if (typeof global.name !== "undefined") { this.globalsOffsetByIdentifier[global.name.value] = this.globals.length - 1; } } }, { key: "importGlobal", value: function importGlobal(type, mutability) { this.globals.push({ type: type, mutability: mutability }); } }, { key: "isMutableGlobal", value: function isMutableGlobal(index) { return this.globals[index].mutability === "var"; } }, { key: "isImmutableGlobal", value: function isImmutableGlobal(index) { return this.globals[index].mutability === "const"; } /** * Memories */ }, { key: "hasMemory", value: function hasMemory(index) { return this.mems.length > index && index >= 0; } }, { key: "addMemory", value: function addMemory(min, max) { this.mems.push({ min: min, max: max }); } }, { key: "getMemory", value: function getMemory(index) { return this.mems[index]; } }]); return ModuleContext; }(); exports.ModuleContext = ModuleContext; /***/ }), /***/ 34390: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.traverse = traverse; var _nodePath = __webpack_require__(27110); var _nodes = __webpack_require__(36588); // recursively walks the AST starting at the given node. The callback is invoked for // and object that has a 'type' property. function walk(context, callback) { var stop = false; function innerWalk(context, callback) { if (stop) { return; } var node = context.node; if (node === undefined) { console.warn("traversing with an empty context"); return; } if (node._deleted === true) { return; } var path = (0, _nodePath.createPath)(context); callback(node.type, path); if (path.shouldStop) { stop = true; return; } Object.keys(node).forEach(function (prop) { var value = node[prop]; if (value === null || value === undefined) { return; } var valueAsArray = Array.isArray(value) ? value : [value]; valueAsArray.forEach(function (childNode) { if (typeof childNode.type === "string") { var childContext = { node: childNode, parentKey: prop, parentPath: path, shouldStop: false, inList: Array.isArray(value) }; innerWalk(childContext, callback); } }); }); } innerWalk(context, callback); } var noop = function noop() {}; function traverse(node, visitors) { var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop; var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop; Object.keys(visitors).forEach(function (visitor) { if (!_nodes.nodeAndUnionTypes.includes(visitor)) { throw new Error("Unexpected visitor ".concat(visitor)); } }); var context = { node: node, inList: false, shouldStop: false, parentPath: null, parentKey: null }; walk(context, function (type, path) { if (typeof visitors[type] === "function") { before(type, path); visitors[type](path); after(type, path); } var unionTypes = _nodes.unionTypesMap[type]; if (!unionTypes) { throw new Error("Unexpected node type ".concat(type)); } unionTypes.forEach(function (unionType) { if (typeof visitors[unionType] === "function") { before(unionType, path); visitors[unionType](path); after(unionType, path); } }); }); } /***/ }), /***/ 26038: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isAnonymous = isAnonymous; exports.getSectionMetadata = getSectionMetadata; exports.getSectionMetadatas = getSectionMetadatas; exports.sortSectionMetadata = sortSectionMetadata; exports.orderedInsertNode = orderedInsertNode; exports.assertHasLoc = assertHasLoc; exports.getEndOfSection = getEndOfSection; exports.shiftLoc = shiftLoc; exports.shiftSection = shiftSection; exports.signatureForOpcode = signatureForOpcode; exports.getUniqueNameGenerator = getUniqueNameGenerator; exports.getStartByteOffset = getStartByteOffset; exports.getEndByteOffset = getEndByteOffset; exports.getFunctionBeginingByteOffset = getFunctionBeginingByteOffset; exports.getEndBlockByteOffset = getEndBlockByteOffset; exports.getStartBlockByteOffset = getStartBlockByteOffset; var _signatures = __webpack_require__(14004); var _traverse = __webpack_require__(34390); var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(97527)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function isAnonymous(ident) { return ident.raw === ""; } function getSectionMetadata(ast, name) { var section; (0, _traverse.traverse)(ast, { SectionMetadata: function (_SectionMetadata) { function SectionMetadata(_x) { return _SectionMetadata.apply(this, arguments); } SectionMetadata.toString = function () { return _SectionMetadata.toString(); }; return SectionMetadata; }(function (_ref) { var node = _ref.node; if (node.section === name) { section = node; } }) }); return section; } function getSectionMetadatas(ast, name) { var sections = []; (0, _traverse.traverse)(ast, { SectionMetadata: function (_SectionMetadata2) { function SectionMetadata(_x2) { return _SectionMetadata2.apply(this, arguments); } SectionMetadata.toString = function () { return _SectionMetadata2.toString(); }; return SectionMetadata; }(function (_ref2) { var node = _ref2.node; if (node.section === name) { sections.push(node); } }) }); return sections; } function sortSectionMetadata(m) { if (m.metadata == null) { console.warn("sortSectionMetadata: no metadata to sort"); return; } // $FlowIgnore m.metadata.sections.sort(function (a, b) { var aId = _helperWasmBytecode.default.sections[a.section]; var bId = _helperWasmBytecode.default.sections[b.section]; if (typeof aId !== "number" || typeof bId !== "number") { throw new Error("Section id not found"); } return aId - bId; }); } function orderedInsertNode(m, n) { assertHasLoc(n); var didInsert = false; if (n.type === "ModuleExport") { m.fields.push(n); return; } m.fields = m.fields.reduce(function (acc, field) { var fieldEndCol = Infinity; if (field.loc != null) { // $FlowIgnore fieldEndCol = field.loc.end.column; } // $FlowIgnore: assertHasLoc ensures that if (didInsert === false && n.loc.start.column < fieldEndCol) { didInsert = true; acc.push(n); } acc.push(field); return acc; }, []); // Handles empty modules or n is the last element if (didInsert === false) { m.fields.push(n); } } function assertHasLoc(n) { if (n.loc == null || n.loc.start == null || n.loc.end == null) { throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information")); } } function getEndOfSection(s) { assertHasLoc(s.size); return s.startOffset + s.size.value + ( // $FlowIgnore s.size.loc.end.column - s.size.loc.start.column); } function shiftLoc(node, delta) { // $FlowIgnore node.loc.start.column += delta; // $FlowIgnore node.loc.end.column += delta; } function shiftSection(ast, node, delta) { if (node.type !== "SectionMetadata") { throw new Error("Can not shift node " + JSON.stringify(node.type)); } node.startOffset += delta; if (_typeof(node.size.loc) === "object") { shiftLoc(node.size, delta); } // Custom sections doesn't have vectorOfSize if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") { shiftLoc(node.vectorOfSize, delta); } var sectionName = node.section; // shift node locations within that section (0, _traverse.traverse)(ast, { Node: function Node(_ref3) { var node = _ref3.node; var section = (0, _helperWasmBytecode.getSectionForNode)(node); if (section === sectionName && _typeof(node.loc) === "object") { shiftLoc(node, delta); } } }); } function signatureForOpcode(object, name) { var opcodeName = name; if (object !== undefined && object !== "") { opcodeName = object + "." + name; } var sign = _signatures.signatures[opcodeName]; if (sign == undefined) { // TODO: Uncomment this when br_table and others has been done //throw new Error("Invalid opcode: "+opcodeName); return [object, object]; } return sign[0]; } function getUniqueNameGenerator() { var inc = {}; return function () { var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; if (!(prefix in inc)) { inc[prefix] = 0; } else { inc[prefix] = inc[prefix] + 1; } return prefix + "_" + inc[prefix]; }; } function getStartByteOffset(n) { // $FlowIgnore if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") { throw new Error( // $FlowIgnore "Can not get byte offset without loc informations, node: " + String(n.id)); } return n.loc.start.column; } function getEndByteOffset(n) { // $FlowIgnore if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") { throw new Error("Can not get byte offset without loc informations, node: " + n.type); } return n.loc.end.column; } function getFunctionBeginingByteOffset(n) { if (!(n.body.length > 0)) { throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown")); } var _n$body = _slicedToArray(n.body, 1), firstInstruction = _n$body[0]; return getStartByteOffset(firstInstruction); } function getEndBlockByteOffset(n) { // $FlowIgnore if (!(n.instr.length > 0 || n.body.length > 0)) { throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); } var lastInstruction; if (n.instr) { // $FlowIgnore lastInstruction = n.instr[n.instr.length - 1]; } if (n.body) { // $FlowIgnore lastInstruction = n.body[n.body.length - 1]; } if (!(_typeof(lastInstruction) === "object")) { throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown")); } // $FlowIgnore return getStartByteOffset(lastInstruction); } function getStartBlockByteOffset(n) { // $FlowIgnore if (!(n.instr.length > 0 || n.body.length > 0)) { throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown")); } var fistInstruction; if (n.instr) { // $FlowIgnore var _n$instr = _slicedToArray(n.instr, 1); fistInstruction = _n$instr[0]; } if (n.body) { // $FlowIgnore var _n$body2 = _slicedToArray(n.body, 1); fistInstruction = _n$body2[0]; } if (!(_typeof(fistInstruction) === "object")) { throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown")); } // $FlowIgnore return getStartByteOffset(fistInstruction); } /***/ }), /***/ 83268: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = parse; function parse(input) { input = input.toUpperCase(); var splitIndex = input.indexOf("P"); var mantissa, exponent; if (splitIndex !== -1) { mantissa = input.substring(0, splitIndex); exponent = parseInt(input.substring(splitIndex + 1)); } else { mantissa = input; exponent = 0; } var dotIndex = mantissa.indexOf("."); if (dotIndex !== -1) { var integerPart = parseInt(mantissa.substring(0, dotIndex), 16); var sign = Math.sign(integerPart); integerPart = sign * integerPart; var fractionLength = mantissa.length - dotIndex - 1; var fractionalPart = parseInt(mantissa.substring(dotIndex + 1), 16); var fraction = fractionLength > 0 ? fractionalPart / Math.pow(16, fractionLength) : 0; if (sign === 0) { if (fraction === 0) { mantissa = sign; } else { if (Object.is(sign, -0)) { mantissa = -fraction; } else { mantissa = fraction; } } } else { mantissa = sign * (integerPart + fraction); } } else { mantissa = parseInt(mantissa, 16); } return mantissa * (splitIndex !== -1 ? Math.pow(2, exponent) : 1); } /***/ }), /***/ 36194: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LinkError = exports.CompileError = exports.RuntimeError = void 0; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var RuntimeError = /*#__PURE__*/ function (_Error) { _inherits(RuntimeError, _Error); function RuntimeError() { _classCallCheck(this, RuntimeError); return _possibleConstructorReturn(this, (RuntimeError.__proto__ || Object.getPrototypeOf(RuntimeError)).apply(this, arguments)); } return RuntimeError; }(Error); exports.RuntimeError = RuntimeError; var CompileError = /*#__PURE__*/ function (_Error2) { _inherits(CompileError, _Error2); function CompileError() { _classCallCheck(this, CompileError); return _possibleConstructorReturn(this, (CompileError.__proto__ || Object.getPrototypeOf(CompileError)).apply(this, arguments)); } return CompileError; }(Error); exports.CompileError = CompileError; var LinkError = /*#__PURE__*/ function (_Error3) { _inherits(LinkError, _Error3); function LinkError() { _classCallCheck(this, LinkError); return _possibleConstructorReturn(this, (LinkError.__proto__ || Object.getPrototypeOf(LinkError)).apply(this, arguments)); } return LinkError; }(Error); exports.LinkError = LinkError; /***/ }), /***/ 57827: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.overrideBytesInBuffer = overrideBytesInBuffer; exports.makeBuffer = makeBuffer; exports.fromHexdump = fromHexdump; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function concatUint8Arrays() { for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { arrays[_key] = arguments[_key]; } var totalLength = arrays.reduce(function (a, b) { return a + b.length; }, 0); var result = new Uint8Array(totalLength); var offset = 0; for (var _i = 0; _i < arrays.length; _i++) { var arr = arrays[_i]; if (arr instanceof Uint8Array === false) { throw new Error("arr must be of type Uint8Array"); } result.set(arr, offset); offset += arr.length; } return result; } function overrideBytesInBuffer(buffer, startLoc, endLoc, newBytes) { var beforeBytes = buffer.slice(0, startLoc); var afterBytes = buffer.slice(endLoc, buffer.length); // replacement is empty, we can omit it if (newBytes.length === 0) { return concatUint8Arrays(beforeBytes, afterBytes); } var replacement = Uint8Array.from(newBytes); return concatUint8Arrays(beforeBytes, replacement, afterBytes); } function makeBuffer() { for (var _len2 = arguments.length, splitedBytes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { splitedBytes[_key2] = arguments[_key2]; } var bytes = [].concat.apply([], splitedBytes); return new Uint8Array(bytes).buffer; } function fromHexdump(str) { var lines = str.split("\n"); // remove any leading left whitespace lines = lines.map(function (line) { return line.trim(); }); var bytes = lines.reduce(function (acc, line) { var cols = line.split(" "); // remove the offset, left column cols.shift(); cols = cols.filter(function (x) { return x !== ""; }); var bytes = cols.map(function (x) { return parseInt(x, 16); }); acc.push.apply(acc, _toConsumableArray(bytes)); return acc; }, []); return Buffer.from(bytes); } /***/ }), /***/ 27716: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parse32F = parse32F; exports.parse64F = parse64F; exports.parse32I = parse32I; exports.parseU32 = parseU32; exports.parse64I = parse64I; exports.isInfLiteral = isInfLiteral; exports.isNanLiteral = isNanLiteral; var _long = _interopRequireDefault(__webpack_require__(77960)); var _floatingPointHexParser = _interopRequireDefault(__webpack_require__(83268)); var _helperApiError = __webpack_require__(36194); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function parse32F(sourceString) { if (isHexLiteral(sourceString)) { return (0, _floatingPointHexParser.default)(sourceString); } if (isInfLiteral(sourceString)) { return sourceString[0] === "-" ? -1 : 1; } if (isNanLiteral(sourceString)) { return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x400000); } return parseFloat(sourceString); } function parse64F(sourceString) { if (isHexLiteral(sourceString)) { return (0, _floatingPointHexParser.default)(sourceString); } if (isInfLiteral(sourceString)) { return sourceString[0] === "-" ? -1 : 1; } if (isNanLiteral(sourceString)) { return (sourceString[0] === "-" ? -1 : 1) * (sourceString.includes(":") ? parseInt(sourceString.substring(sourceString.indexOf(":") + 1), 16) : 0x8000000000000); } if (isHexLiteral(sourceString)) { return (0, _floatingPointHexParser.default)(sourceString); } return parseFloat(sourceString); } function parse32I(sourceString) { var value = 0; if (isHexLiteral(sourceString)) { value = ~~parseInt(sourceString, 16); } else if (isDecimalExponentLiteral(sourceString)) { throw new Error("This number literal format is yet to be implemented."); } else { value = parseInt(sourceString, 10); } return value; } function parseU32(sourceString) { var value = parse32I(sourceString); if (value < 0) { throw new _helperApiError.CompileError("Illegal value for u32: " + sourceString); } return value; } function parse64I(sourceString) { var long; if (isHexLiteral(sourceString)) { long = _long.default.fromString(sourceString, false, 16); } else if (isDecimalExponentLiteral(sourceString)) { throw new Error("This number literal format is yet to be implemented."); } else { long = _long.default.fromString(sourceString); } return { high: long.high, low: long.low }; } var NAN_WORD = /^\+?-?nan/; var INF_WORD = /^\+?-?inf/; function isInfLiteral(sourceString) { return INF_WORD.test(sourceString.toLowerCase()); } function isNanLiteral(sourceString) { return NAN_WORD.test(sourceString.toLowerCase()); } function isDecimalExponentLiteral(sourceString) { return !isHexLiteral(sourceString) && sourceString.toUpperCase().includes("E"); } function isHexLiteral(sourceString) { return sourceString.substring(0, 2).toUpperCase() === "0X" || sourceString.substring(0, 3).toUpperCase() === "-0X"; } /***/ }), /***/ 97527: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "getSectionForNode", ({ enumerable: true, get: function get() { return _section.getSectionForNode; } })); exports.default = void 0; var _section = __webpack_require__(36996); var illegalop = "illegal"; var magicModuleHeader = [0x00, 0x61, 0x73, 0x6d]; var moduleVersion = [0x01, 0x00, 0x00, 0x00]; function invertMap(obj) { var keyModifierFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (k) { return k; }; var result = {}; var keys = Object.keys(obj); for (var i = 0, length = keys.length; i < length; i++) { result[keyModifierFn(obj[keys[i]])] = keys[i]; } return result; } function createSymbolObject(name /*: string */ , object /*: string */ ) /*: Symbol*/ { var numberOfArgs /*: number*/ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; return { name: name, object: object, numberOfArgs: numberOfArgs }; } function createSymbol(name /*: string */ ) /*: Symbol*/ { var numberOfArgs /*: number*/ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; return { name: name, numberOfArgs: numberOfArgs }; } var types = { func: 0x60, result: 0x40 }; var exportTypes = { 0x00: "Func", 0x01: "Table", 0x02: "Mem", 0x03: "Global" }; var exportTypesByName = invertMap(exportTypes); var valtypes = { 0x7f: "i32", 0x7e: "i64", 0x7d: "f32", 0x7c: "f64", 0x7b: "v128" }; var valtypesByString = invertMap(valtypes); var tableTypes = { 0x70: "anyfunc" }; var blockTypes = Object.assign({}, valtypes, { // https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype 0x40: null, // https://webassembly.github.io/spec/core/binary/types.html#binary-valtype 0x7f: "i32", 0x7e: "i64", 0x7d: "f32", 0x7c: "f64" }); var globalTypes = { 0x00: "const", 0x01: "var" }; var globalTypesByString = invertMap(globalTypes); var importTypes = { 0x00: "func", 0x01: "table", 0x02: "mem", 0x03: "global" }; var sections = { custom: 0, type: 1, import: 2, func: 3, table: 4, memory: 5, global: 6, export: 7, start: 8, element: 9, code: 10, data: 11 }; var symbolsByByte = { 0x00: createSymbol("unreachable"), 0x01: createSymbol("nop"), 0x02: createSymbol("block"), 0x03: createSymbol("loop"), 0x04: createSymbol("if"), 0x05: createSymbol("else"), 0x06: illegalop, 0x07: illegalop, 0x08: illegalop, 0x09: illegalop, 0x0a: illegalop, 0x0b: createSymbol("end"), 0x0c: createSymbol("br", 1), 0x0d: createSymbol("br_if", 1), 0x0e: createSymbol("br_table"), 0x0f: createSymbol("return"), 0x10: createSymbol("call", 1), 0x11: createSymbol("call_indirect", 2), 0x12: illegalop, 0x13: illegalop, 0x14: illegalop, 0x15: illegalop, 0x16: illegalop, 0x17: illegalop, 0x18: illegalop, 0x19: illegalop, 0x1a: createSymbol("drop"), 0x1b: createSymbol("select"), 0x1c: illegalop, 0x1d: illegalop, 0x1e: illegalop, 0x1f: illegalop, 0x20: createSymbol("get_local", 1), 0x21: createSymbol("set_local", 1), 0x22: createSymbol("tee_local", 1), 0x23: createSymbol("get_global", 1), 0x24: createSymbol("set_global", 1), 0x25: illegalop, 0x26: illegalop, 0x27: illegalop, 0x28: createSymbolObject("load", "u32", 1), 0x29: createSymbolObject("load", "u64", 1), 0x2a: createSymbolObject("load", "f32", 1), 0x2b: createSymbolObject("load", "f64", 1), 0x2c: createSymbolObject("load8_s", "u32", 1), 0x2d: createSymbolObject("load8_u", "u32", 1), 0x2e: createSymbolObject("load16_s", "u32", 1), 0x2f: createSymbolObject("load16_u", "u32", 1), 0x30: createSymbolObject("load8_s", "u64", 1), 0x31: createSymbolObject("load8_u", "u64", 1), 0x32: createSymbolObject("load16_s", "u64", 1), 0x33: createSymbolObject("load16_u", "u64", 1), 0x34: createSymbolObject("load32_s", "u64", 1), 0x35: createSymbolObject("load32_u", "u64", 1), 0x36: createSymbolObject("store", "u32", 1), 0x37: createSymbolObject("store", "u64", 1), 0x38: createSymbolObject("store", "f32", 1), 0x39: createSymbolObject("store", "f64", 1), 0x3a: createSymbolObject("store8", "u32", 1), 0x3b: createSymbolObject("store16", "u32", 1), 0x3c: createSymbolObject("store8", "u64", 1), 0x3d: createSymbolObject("store16", "u64", 1), 0x3e: createSymbolObject("store32", "u64", 1), 0x3f: createSymbolObject("current_memory"), 0x40: createSymbolObject("grow_memory"), 0x41: createSymbolObject("const", "i32", 1), 0x42: createSymbolObject("const", "i64", 1), 0x43: createSymbolObject("const", "f32", 1), 0x44: createSymbolObject("const", "f64", 1), 0x45: createSymbolObject("eqz", "i32"), 0x46: createSymbolObject("eq", "i32"), 0x47: createSymbolObject("ne", "i32"), 0x48: createSymbolObject("lt_s", "i32"), 0x49: createSymbolObject("lt_u", "i32"), 0x4a: createSymbolObject("gt_s", "i32"), 0x4b: createSymbolObject("gt_u", "i32"), 0x4c: createSymbolObject("le_s", "i32"), 0x4d: createSymbolObject("le_u", "i32"), 0x4e: createSymbolObject("ge_s", "i32"), 0x4f: createSymbolObject("ge_u", "i32"), 0x50: createSymbolObject("eqz", "i64"), 0x51: createSymbolObject("eq", "i64"), 0x52: createSymbolObject("ne", "i64"), 0x53: createSymbolObject("lt_s", "i64"), 0x54: createSymbolObject("lt_u", "i64"), 0x55: createSymbolObject("gt_s", "i64"), 0x56: createSymbolObject("gt_u", "i64"), 0x57: createSymbolObject("le_s", "i64"), 0x58: createSymbolObject("le_u", "i64"), 0x59: createSymbolObject("ge_s", "i64"), 0x5a: createSymbolObject("ge_u", "i64"), 0x5b: createSymbolObject("eq", "f32"), 0x5c: createSymbolObject("ne", "f32"), 0x5d: createSymbolObject("lt", "f32"), 0x5e: createSymbolObject("gt", "f32"), 0x5f: createSymbolObject("le", "f32"), 0x60: createSymbolObject("ge", "f32"), 0x61: createSymbolObject("eq", "f64"), 0x62: createSymbolObject("ne", "f64"), 0x63: createSymbolObject("lt", "f64"), 0x64: createSymbolObject("gt", "f64"), 0x65: createSymbolObject("le", "f64"), 0x66: createSymbolObject("ge", "f64"), 0x67: createSymbolObject("clz", "i32"), 0x68: createSymbolObject("ctz", "i32"), 0x69: createSymbolObject("popcnt", "i32"), 0x6a: createSymbolObject("add", "i32"), 0x6b: createSymbolObject("sub", "i32"), 0x6c: createSymbolObject("mul", "i32"), 0x6d: createSymbolObject("div_s", "i32"), 0x6e: createSymbolObject("div_u", "i32"), 0x6f: createSymbolObject("rem_s", "i32"), 0x70: createSymbolObject("rem_u", "i32"), 0x71: createSymbolObject("and", "i32"), 0x72: createSymbolObject("or", "i32"), 0x73: createSymbolObject("xor", "i32"), 0x74: createSymbolObject("shl", "i32"), 0x75: createSymbolObject("shr_s", "i32"), 0x76: createSymbolObject("shr_u", "i32"), 0x77: createSymbolObject("rotl", "i32"), 0x78: createSymbolObject("rotr", "i32"), 0x79: createSymbolObject("clz", "i64"), 0x7a: createSymbolObject("ctz", "i64"), 0x7b: createSymbolObject("popcnt", "i64"), 0x7c: createSymbolObject("add", "i64"), 0x7d: createSymbolObject("sub", "i64"), 0x7e: createSymbolObject("mul", "i64"), 0x7f: createSymbolObject("div_s", "i64"), 0x80: createSymbolObject("div_u", "i64"), 0x81: createSymbolObject("rem_s", "i64"), 0x82: createSymbolObject("rem_u", "i64"), 0x83: createSymbolObject("and", "i64"), 0x84: createSymbolObject("or", "i64"), 0x85: createSymbolObject("xor", "i64"), 0x86: createSymbolObject("shl", "i64"), 0x87: createSymbolObject("shr_s", "i64"), 0x88: createSymbolObject("shr_u", "i64"), 0x89: createSymbolObject("rotl", "i64"), 0x8a: createSymbolObject("rotr", "i64"), 0x8b: createSymbolObject("abs", "f32"), 0x8c: createSymbolObject("neg", "f32"), 0x8d: createSymbolObject("ceil", "f32"), 0x8e: createSymbolObject("floor", "f32"), 0x8f: createSymbolObject("trunc", "f32"), 0x90: createSymbolObject("nearest", "f32"), 0x91: createSymbolObject("sqrt", "f32"), 0x92: createSymbolObject("add", "f32"), 0x93: createSymbolObject("sub", "f32"), 0x94: createSymbolObject("mul", "f32"), 0x95: createSymbolObject("div", "f32"), 0x96: createSymbolObject("min", "f32"), 0x97: createSymbolObject("max", "f32"), 0x98: createSymbolObject("copysign", "f32"), 0x99: createSymbolObject("abs", "f64"), 0x9a: createSymbolObject("neg", "f64"), 0x9b: createSymbolObject("ceil", "f64"), 0x9c: createSymbolObject("floor", "f64"), 0x9d: createSymbolObject("trunc", "f64"), 0x9e: createSymbolObject("nearest", "f64"), 0x9f: createSymbolObject("sqrt", "f64"), 0xa0: createSymbolObject("add", "f64"), 0xa1: createSymbolObject("sub", "f64"), 0xa2: createSymbolObject("mul", "f64"), 0xa3: createSymbolObject("div", "f64"), 0xa4: createSymbolObject("min", "f64"), 0xa5: createSymbolObject("max", "f64"), 0xa6: createSymbolObject("copysign", "f64"), 0xa7: createSymbolObject("wrap/i64", "i32"), 0xa8: createSymbolObject("trunc_s/f32", "i32"), 0xa9: createSymbolObject("trunc_u/f32", "i32"), 0xaa: createSymbolObject("trunc_s/f64", "i32"), 0xab: createSymbolObject("trunc_u/f64", "i32"), 0xac: createSymbolObject("extend_s/i32", "i64"), 0xad: createSymbolObject("extend_u/i32", "i64"), 0xae: createSymbolObject("trunc_s/f32", "i64"), 0xaf: createSymbolObject("trunc_u/f32", "i64"), 0xb0: createSymbolObject("trunc_s/f64", "i64"), 0xb1: createSymbolObject("trunc_u/f64", "i64"), 0xb2: createSymbolObject("convert_s/i32", "f32"), 0xb3: createSymbolObject("convert_u/i32", "f32"), 0xb4: createSymbolObject("convert_s/i64", "f32"), 0xb5: createSymbolObject("convert_u/i64", "f32"), 0xb6: createSymbolObject("demote/f64", "f32"), 0xb7: createSymbolObject("convert_s/i32", "f64"), 0xb8: createSymbolObject("convert_u/i32", "f64"), 0xb9: createSymbolObject("convert_s/i64", "f64"), 0xba: createSymbolObject("convert_u/i64", "f64"), 0xbb: createSymbolObject("promote/f32", "f64"), 0xbc: createSymbolObject("reinterpret/f32", "i32"), 0xbd: createSymbolObject("reinterpret/f64", "i64"), 0xbe: createSymbolObject("reinterpret/i32", "f32"), 0xbf: createSymbolObject("reinterpret/i64", "f64"), // Atomic Memory Instructions 0xfe00: createSymbol("memory.atomic.notify", 1), 0xfe01: createSymbol("memory.atomic.wait32", 1), 0xfe02: createSymbol("memory.atomic.wait64", 1), 0xfe10: createSymbolObject("atomic.load", "i32", 1), 0xfe11: createSymbolObject("atomic.load", "i64", 1), 0xfe12: createSymbolObject("atomic.load8_u", "i32", 1), 0xfe13: createSymbolObject("atomic.load16_u", "i32", 1), 0xfe14: createSymbolObject("atomic.load8_u", "i64", 1), 0xfe15: createSymbolObject("atomic.load16_u", "i64", 1), 0xfe16: createSymbolObject("atomic.load32_u", "i64", 1), 0xfe17: createSymbolObject("atomic.store", "i32", 1), 0xfe18: createSymbolObject("atomic.store", "i64", 1), 0xfe19: createSymbolObject("atomic.store8_u", "i32", 1), 0xfe1a: createSymbolObject("atomic.store16_u", "i32", 1), 0xfe1b: createSymbolObject("atomic.store8_u", "i64", 1), 0xfe1c: createSymbolObject("atomic.store16_u", "i64", 1), 0xfe1d: createSymbolObject("atomic.store32_u", "i64", 1), 0xfe1e: createSymbolObject("atomic.rmw.add", "i32", 1), 0xfe1f: createSymbolObject("atomic.rmw.add", "i64", 1), 0xfe20: createSymbolObject("atomic.rmw8_u.add_u", "i32", 1), 0xfe21: createSymbolObject("atomic.rmw16_u.add_u", "i32", 1), 0xfe22: createSymbolObject("atomic.rmw8_u.add_u", "i64", 1), 0xfe23: createSymbolObject("atomic.rmw16_u.add_u", "i64", 1), 0xfe24: createSymbolObject("atomic.rmw32_u.add_u", "i64", 1), 0xfe25: createSymbolObject("atomic.rmw.sub", "i32", 1), 0xfe26: createSymbolObject("atomic.rmw.sub", "i64", 1), 0xfe27: createSymbolObject("atomic.rmw8_u.sub_u", "i32", 1), 0xfe28: createSymbolObject("atomic.rmw16_u.sub_u", "i32", 1), 0xfe29: createSymbolObject("atomic.rmw8_u.sub_u", "i64", 1), 0xfe2a: createSymbolObject("atomic.rmw16_u.sub_u", "i64", 1), 0xfe2b: createSymbolObject("atomic.rmw32_u.sub_u", "i64", 1), 0xfe2c: createSymbolObject("atomic.rmw.and", "i32", 1), 0xfe2d: createSymbolObject("atomic.rmw.and", "i64", 1), 0xfe2e: createSymbolObject("atomic.rmw8_u.and_u", "i32", 1), 0xfe2f: createSymbolObject("atomic.rmw16_u.and_u", "i32", 1), 0xfe30: createSymbolObject("atomic.rmw8_u.and_u", "i64", 1), 0xfe31: createSymbolObject("atomic.rmw16_u.and_u", "i64", 1), 0xfe32: createSymbolObject("atomic.rmw32_u.and_u", "i64", 1), 0xfe33: createSymbolObject("atomic.rmw.or", "i32", 1), 0xfe34: createSymbolObject("atomic.rmw.or", "i64", 1), 0xfe35: createSymbolObject("atomic.rmw8_u.or_u", "i32", 1), 0xfe36: createSymbolObject("atomic.rmw16_u.or_u", "i32", 1), 0xfe37: createSymbolObject("atomic.rmw8_u.or_u", "i64", 1), 0xfe38: createSymbolObject("atomic.rmw16_u.or_u", "i64", 1), 0xfe39: createSymbolObject("atomic.rmw32_u.or_u", "i64", 1), 0xfe3a: createSymbolObject("atomic.rmw.xor", "i32", 1), 0xfe3b: createSymbolObject("atomic.rmw.xor", "i64", 1), 0xfe3c: createSymbolObject("atomic.rmw8_u.xor_u", "i32", 1), 0xfe3d: createSymbolObject("atomic.rmw16_u.xor_u", "i32", 1), 0xfe3e: createSymbolObject("atomic.rmw8_u.xor_u", "i64", 1), 0xfe3f: createSymbolObject("atomic.rmw16_u.xor_u", "i64", 1), 0xfe40: createSymbolObject("atomic.rmw32_u.xor_u", "i64", 1), 0xfe41: createSymbolObject("atomic.rmw.xchg", "i32", 1), 0xfe42: createSymbolObject("atomic.rmw.xchg", "i64", 1), 0xfe43: createSymbolObject("atomic.rmw8_u.xchg_u", "i32", 1), 0xfe44: createSymbolObject("atomic.rmw16_u.xchg_u", "i32", 1), 0xfe45: createSymbolObject("atomic.rmw8_u.xchg_u", "i64", 1), 0xfe46: createSymbolObject("atomic.rmw16_u.xchg_u", "i64", 1), 0xfe47: createSymbolObject("atomic.rmw32_u.xchg_u", "i64", 1), 0xfe48: createSymbolObject("atomic.rmw.cmpxchg", "i32", 1), 0xfe49: createSymbolObject("atomic.rmw.cmpxchg", "i64", 1), 0xfe4a: createSymbolObject("atomic.rmw8_u.cmpxchg_u", "i32", 1), 0xfe4b: createSymbolObject("atomic.rmw16_u.cmpxchg_u", "i32", 1), 0xfe4c: createSymbolObject("atomic.rmw8_u.cmpxchg_u", "i64", 1), 0xfe4d: createSymbolObject("atomic.rmw16_u.cmpxchg_u", "i64", 1), 0xfe4e: createSymbolObject("atomic.rmw32_u.cmpxchg_u", "i64", 1) }; var symbolsByName = invertMap(symbolsByByte, function (obj) { if (typeof obj.object === "string") { return "".concat(obj.object, ".").concat(obj.name); } return obj.name; }); var _default = { symbolsByByte: symbolsByByte, sections: sections, magicModuleHeader: magicModuleHeader, moduleVersion: moduleVersion, types: types, valtypes: valtypes, exportTypes: exportTypes, blockTypes: blockTypes, tableTypes: tableTypes, globalTypes: globalTypes, importTypes: importTypes, valtypesByString: valtypesByString, globalTypesByString: globalTypesByString, exportTypesByName: exportTypesByName, symbolsByName: symbolsByName }; exports.default = _default; /***/ }), /***/ 36996: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSectionForNode = getSectionForNode; function getSectionForNode(n) { switch (n.type) { case "ModuleImport": return "import"; case "CallInstruction": case "CallIndirectInstruction": case "Func": case "Instr": return "code"; case "ModuleExport": return "export"; case "Start": return "start"; case "TypeInstruction": return "type"; case "IndexInFuncSection": return "func"; case "Global": return "global"; // No section default: return; } } /***/ }), /***/ 30368: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createEmptySection = createEmptySection; var _wasmGen = __webpack_require__(62394); var _helperBuffer = __webpack_require__(57827); var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(97527)); var t = _interopRequireWildcard(__webpack_require__(98688)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function findLastSection(ast, forSection) { var targetSectionId = _helperWasmBytecode.default.sections[forSection]; // $FlowIgnore: metadata can not be empty var moduleSections = ast.body[0].metadata.sections; var lastSection; var lastId = 0; for (var i = 0, len = moduleSections.length; i < len; i++) { var section = moduleSections[i]; // Ignore custom section since they can actually occur everywhere if (section.section === "custom") { continue; } var sectionId = _helperWasmBytecode.default.sections[section.section]; if (targetSectionId > lastId && targetSectionId < sectionId) { return lastSection; } lastId = sectionId; lastSection = section; } return lastSection; } function createEmptySection(ast, uint8Buffer, section) { // previous section after which we are going to insert our section var lastSection = findLastSection(ast, section); var start, end; /** * It's the first section */ if (lastSection == null || lastSection.section === "custom") { start = 8 /* wasm header size */ ; end = start; } else { start = lastSection.startOffset + lastSection.size.value + 1; end = start; } // section id start += 1; var sizeStartLoc = { line: -1, column: start }; var sizeEndLoc = { line: -1, column: start + 1 }; // 1 byte for the empty vector var size = t.withLoc(t.numberLiteralFromRaw(1), sizeEndLoc, sizeStartLoc); var vectorOfSizeStartLoc = { line: -1, column: sizeEndLoc.column }; var vectorOfSizeEndLoc = { line: -1, column: sizeEndLoc.column + 1 }; var vectorOfSize = t.withLoc(t.numberLiteralFromRaw(0), vectorOfSizeEndLoc, vectorOfSizeStartLoc); var sectionMetadata = t.sectionMetadata(section, start, size, vectorOfSize); var sectionBytes = (0, _wasmGen.encodeNode)(sectionMetadata); uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start - 1, end, sectionBytes); // Add section into the AST for later lookups if (_typeof(ast.body[0].metadata) === "object") { // $FlowIgnore: metadata can not be empty ast.body[0].metadata.sections.push(sectionMetadata); t.sortSectionMetadata(ast.body[0]); } /** * Update AST */ // Once we hit our section every that is after needs to be shifted by the delta var deltaBytes = +sectionBytes.length; var encounteredSection = false; t.traverse(ast, { SectionMetadata: function SectionMetadata(path) { if (path.node.section === section) { encounteredSection = true; return; } if (encounteredSection === true) { t.shiftSection(ast, path.node, deltaBytes); } } }); return { uint8Buffer: uint8Buffer, sectionMetadata: sectionMetadata }; } /***/ }), /***/ 37427: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "resizeSectionByteSize", ({ enumerable: true, get: function get() { return _resize.resizeSectionByteSize; } })); Object.defineProperty(exports, "resizeSectionVecSize", ({ enumerable: true, get: function get() { return _resize.resizeSectionVecSize; } })); Object.defineProperty(exports, "createEmptySection", ({ enumerable: true, get: function get() { return _create.createEmptySection; } })); Object.defineProperty(exports, "removeSections", ({ enumerable: true, get: function get() { return _remove.removeSections; } })); var _resize = __webpack_require__(32230); var _create = __webpack_require__(30368); var _remove = __webpack_require__(70140); /***/ }), /***/ 70140: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.removeSections = removeSections; var _ast = __webpack_require__(98688); var _helperBuffer = __webpack_require__(57827); function removeSections(ast, uint8Buffer, section) { var sectionMetadatas = (0, _ast.getSectionMetadatas)(ast, section); if (sectionMetadatas.length === 0) { throw new Error("Section metadata not found"); } return sectionMetadatas.reverse().reduce(function (uint8Buffer, sectionMetadata) { var startsIncludingId = sectionMetadata.startOffset - 1; var ends = section === "start" ? sectionMetadata.size.loc.end.column + 1 : sectionMetadata.startOffset + sectionMetadata.size.value + 1; var delta = -(ends - startsIncludingId); /** * update AST */ // Once we hit our section every that is after needs to be shifted by the delta var encounteredSection = false; (0, _ast.traverse)(ast, { SectionMetadata: function SectionMetadata(path) { if (path.node.section === section) { encounteredSection = true; return path.remove(); } if (encounteredSection === true) { (0, _ast.shiftSection)(ast, path.node, delta); } } }); // replacement is nothing var replacement = []; return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, startsIncludingId, ends, replacement); }, uint8Buffer); } /***/ }), /***/ 32230: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resizeSectionByteSize = resizeSectionByteSize; exports.resizeSectionVecSize = resizeSectionVecSize; var _wasmGen = __webpack_require__(62394); var _ast = __webpack_require__(98688); var _helperBuffer = __webpack_require__(57827); function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); if (typeof sectionMetadata === "undefined") { throw new Error("Section metadata not found"); } if (typeof sectionMetadata.size.loc === "undefined") { throw new Error("SectionMetadata " + section + " has no loc"); } // keep old node location to be overriden var start = sectionMetadata.size.loc.start.column; var end = sectionMetadata.size.loc.end.column; var newSectionSize = sectionMetadata.size.value + deltaBytes; var newBytes = (0, _wasmGen.encodeU32)(newSectionSize); /** * update AST */ sectionMetadata.size.value = newSectionSize; var oldu32EncodedLen = end - start; var newu32EncodedLen = newBytes.length; // the new u32 has a different encoded length if (newu32EncodedLen !== oldu32EncodedLen) { var deltaInSizeEncoding = newu32EncodedLen - oldu32EncodedLen; sectionMetadata.size.loc.end.column = start + newu32EncodedLen; deltaBytes += deltaInSizeEncoding; // move the vec size pointer size the section size is now smaller sectionMetadata.vectorOfSize.loc.start.column += deltaInSizeEncoding; sectionMetadata.vectorOfSize.loc.end.column += deltaInSizeEncoding; } // Once we hit our section every that is after needs to be shifted by the delta var encounteredSection = false; (0, _ast.traverse)(ast, { SectionMetadata: function SectionMetadata(path) { if (path.node.section === section) { encounteredSection = true; return; } if (encounteredSection === true) { (0, _ast.shiftSection)(ast, path.node, deltaBytes); } } }); return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); } function resizeSectionVecSize(ast, uint8Buffer, section, deltaElements) { var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); if (typeof sectionMetadata === "undefined") { throw new Error("Section metadata not found"); } if (typeof sectionMetadata.vectorOfSize.loc === "undefined") { throw new Error("SectionMetadata " + section + " has no loc"); } // Section has no vector if (sectionMetadata.vectorOfSize.value === -1) { return uint8Buffer; } // keep old node location to be overriden var start = sectionMetadata.vectorOfSize.loc.start.column; var end = sectionMetadata.vectorOfSize.loc.end.column; var newValue = sectionMetadata.vectorOfSize.value + deltaElements; var newBytes = (0, _wasmGen.encodeU32)(newValue); // Update AST sectionMetadata.vectorOfSize.value = newValue; sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length; return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); } /***/ }), /***/ 23408: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encodeF32 = encodeF32; exports.encodeF64 = encodeF64; exports.decodeF32 = decodeF32; exports.decodeF64 = decodeF64; exports.DOUBLE_PRECISION_MANTISSA = exports.SINGLE_PRECISION_MANTISSA = exports.NUMBER_OF_BYTE_F64 = exports.NUMBER_OF_BYTE_F32 = void 0; var _ieee = __webpack_require__(30848); /** * According to https://webassembly.github.io/spec/binary/values.html#binary-float * n = 32/8 */ var NUMBER_OF_BYTE_F32 = 4; /** * According to https://webassembly.github.io/spec/binary/values.html#binary-float * n = 64/8 */ exports.NUMBER_OF_BYTE_F32 = NUMBER_OF_BYTE_F32; var NUMBER_OF_BYTE_F64 = 8; exports.NUMBER_OF_BYTE_F64 = NUMBER_OF_BYTE_F64; var SINGLE_PRECISION_MANTISSA = 23; exports.SINGLE_PRECISION_MANTISSA = SINGLE_PRECISION_MANTISSA; var DOUBLE_PRECISION_MANTISSA = 52; exports.DOUBLE_PRECISION_MANTISSA = DOUBLE_PRECISION_MANTISSA; function encodeF32(v) { var buffer = []; (0, _ieee.write)(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); return buffer; } function encodeF64(v) { var buffer = []; (0, _ieee.write)(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); return buffer; } function decodeF32(bytes) { var buffer = Buffer.from(bytes); return (0, _ieee.read)(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); } function decodeF64(bytes) { var buffer = Buffer.from(bytes); return (0, _ieee.read)(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); } /***/ }), /***/ 83156: /***/ (function(__unused_webpack_module, exports) { "use strict"; // Copyright 2012 The Obvious Corporation. /* * bits: Bitwise buffer utilities. The utilities here treat a buffer * as a little-endian bigint, so the lowest-order bit is bit #0 of * `buffer[0]`, and the highest-order bit is bit #7 of * `buffer[buffer.length - 1]`. */ /* * Modules used */ /* * Exported bindings */ /** * Extracts the given number of bits from the buffer at the indicated * index, returning a simple number as the result. If bits are requested * that aren't covered by the buffer, the `defaultBit` is used as their * value. * * The `bitLength` must be no more than 32. The `defaultBit` if not * specified is taken to be `0`. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extract = extract; exports.inject = inject; exports.getSign = getSign; exports.highOrder = highOrder; function extract(buffer, bitIndex, bitLength, defaultBit) { if (bitLength < 0 || bitLength > 32) { throw new Error("Bad value for bitLength."); } if (defaultBit === undefined) { defaultBit = 0; } else if (defaultBit !== 0 && defaultBit !== 1) { throw new Error("Bad value for defaultBit."); } var defaultByte = defaultBit * 0xff; var result = 0; // All starts are inclusive. The {endByte, endBit} pair is exclusive, but // if endBit !== 0, then endByte is inclusive. var lastBit = bitIndex + bitLength; var startByte = Math.floor(bitIndex / 8); var startBit = bitIndex % 8; var endByte = Math.floor(lastBit / 8); var endBit = lastBit % 8; if (endBit !== 0) { // `(1 << endBit) - 1` is the mask of all bits up to but not including // the endBit. result = get(endByte) & (1 << endBit) - 1; } while (endByte > startByte) { endByte--; result = result << 8 | get(endByte); } result >>>= startBit; return result; function get(index) { var result = buffer[index]; return result === undefined ? defaultByte : result; } } /** * Injects the given bits into the given buffer at the given index. Any * bits in the value beyond the length to set are ignored. */ function inject(buffer, bitIndex, bitLength, value) { if (bitLength < 0 || bitLength > 32) { throw new Error("Bad value for bitLength."); } var lastByte = Math.floor((bitIndex + bitLength - 1) / 8); if (bitIndex < 0 || lastByte >= buffer.length) { throw new Error("Index out of range."); } // Just keeping it simple, until / unless profiling shows that this // is a problem. var atByte = Math.floor(bitIndex / 8); var atBit = bitIndex % 8; while (bitLength > 0) { if (value & 1) { buffer[atByte] |= 1 << atBit; } else { buffer[atByte] &= ~(1 << atBit); } value >>= 1; bitLength--; atBit = (atBit + 1) % 8; if (atBit === 0) { atByte++; } } } /** * Gets the sign bit of the given buffer. */ function getSign(buffer) { return buffer[buffer.length - 1] >>> 7; } /** * Gets the zero-based bit number of the highest-order bit with the * given value in the given buffer. * * If the buffer consists entirely of the other bit value, then this returns * `-1`. */ function highOrder(bit, buffer) { var length = buffer.length; var fullyWrongByte = (bit ^ 1) * 0xff; // the other-bit extended to a full byte while (length > 0 && buffer[length - 1] === fullyWrongByte) { length--; } if (length === 0) { // Degenerate case. The buffer consists entirely of ~bit. return -1; } var byteToCheck = buffer[length - 1]; var result = length * 8 - 1; for (var i = 7; i > 0; i--) { if ((byteToCheck >> i & 1) === bit) { break; } result--; } return result; } /***/ }), /***/ 84341: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.alloc = alloc; exports.free = free; exports.resize = resize; exports.readInt = readInt; exports.readUInt = readUInt; exports.writeInt64 = writeInt64; exports.writeUInt64 = writeUInt64; // Copyright 2012 The Obvious Corporation. /* * bufs: Buffer utilities. */ /* * Module variables */ /** Pool of buffers, where `bufPool[x].length === x`. */ var bufPool = []; /** Maximum length of kept temporary buffers. */ var TEMP_BUF_MAXIMUM_LENGTH = 20; /** Minimum exactly-representable 64-bit int. */ var MIN_EXACT_INT64 = -0x8000000000000000; /** Maximum exactly-representable 64-bit int. */ var MAX_EXACT_INT64 = 0x7ffffffffffffc00; /** Maximum exactly-representable 64-bit uint. */ var MAX_EXACT_UINT64 = 0xfffffffffffff800; /** * The int value consisting just of a 1 in bit #32 (that is, one more * than the maximum 32-bit unsigned value). */ var BIT_32 = 0x100000000; /** * The int value consisting just of a 1 in bit #64 (that is, one more * than the maximum 64-bit unsigned value). */ var BIT_64 = 0x10000000000000000; /* * Helper functions */ /** * Masks off all but the lowest bit set of the given number. */ function lowestBit(num) { return num & -num; } /** * Gets whether trying to add the second number to the first is lossy * (inexact). The first number is meant to be an accumulated result. */ function isLossyToAdd(accum, num) { if (num === 0) { return false; } var lowBit = lowestBit(num); var added = accum + lowBit; if (added === accum) { return true; } if (added - lowBit !== accum) { return true; } return false; } /* * Exported functions */ /** * Allocates a buffer of the given length, which is initialized * with all zeroes. This returns a buffer from the pool if it is * available, or a freshly-allocated buffer if not. */ function alloc(length) { var result = bufPool[length]; if (result) { bufPool[length] = undefined; } else { result = new Buffer(length); } result.fill(0); return result; } /** * Releases a buffer back to the pool. */ function free(buffer) { var length = buffer.length; if (length < TEMP_BUF_MAXIMUM_LENGTH) { bufPool[length] = buffer; } } /** * Resizes a buffer, returning a new buffer. Returns the argument if * the length wouldn't actually change. This function is only safe to * use if the given buffer was allocated within this module (since * otherwise the buffer might possibly be shared externally). */ function resize(buffer, length) { if (length === buffer.length) { return buffer; } var newBuf = alloc(length); buffer.copy(newBuf); free(buffer); return newBuf; } /** * Reads an arbitrary signed int from a buffer. */ function readInt(buffer) { var length = buffer.length; var positive = buffer[length - 1] < 0x80; var result = positive ? 0 : -1; var lossy = false; // Note: We can't use bit manipulation here, since that stops // working if the result won't fit in a 32-bit int. if (length < 7) { // Common case which can't possibly be lossy (because the result has // no more than 48 bits, and loss only happens with 54 or more). for (var i = length - 1; i >= 0; i--) { result = result * 0x100 + buffer[i]; } } else { for (var _i = length - 1; _i >= 0; _i--) { var one = buffer[_i]; result *= 0x100; if (isLossyToAdd(result, one)) { lossy = true; } result += one; } } return { value: result, lossy: lossy }; } /** * Reads an arbitrary unsigned int from a buffer. */ function readUInt(buffer) { var length = buffer.length; var result = 0; var lossy = false; // Note: See above in re bit manipulation. if (length < 7) { // Common case which can't possibly be lossy (see above). for (var i = length - 1; i >= 0; i--) { result = result * 0x100 + buffer[i]; } } else { for (var _i2 = length - 1; _i2 >= 0; _i2--) { var one = buffer[_i2]; result *= 0x100; if (isLossyToAdd(result, one)) { lossy = true; } result += one; } } return { value: result, lossy: lossy }; } /** * Writes a little-endian 64-bit signed int into a buffer. */ function writeInt64(value, buffer) { if (value < MIN_EXACT_INT64 || value > MAX_EXACT_INT64) { throw new Error("Value out of range."); } if (value < 0) { value += BIT_64; } writeUInt64(value, buffer); } /** * Writes a little-endian 64-bit unsigned int into a buffer. */ function writeUInt64(value, buffer) { if (value < 0 || value > MAX_EXACT_UINT64) { throw new Error("Value out of range."); } var lowWord = value % BIT_32; var highWord = Math.floor(value / BIT_32); buffer.writeUInt32LE(lowWord, 0); buffer.writeUInt32LE(highWord, 4); } /***/ }), /***/ 20942: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeInt64 = decodeInt64; exports.decodeUInt64 = decodeUInt64; exports.decodeInt32 = decodeInt32; exports.decodeUInt32 = decodeUInt32; exports.encodeU32 = encodeU32; exports.encodeI32 = encodeI32; exports.encodeI64 = encodeI64; exports.MAX_NUMBER_OF_BYTE_U64 = exports.MAX_NUMBER_OF_BYTE_U32 = void 0; var _leb = _interopRequireDefault(__webpack_require__(39210)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int * max = ceil(32/7) */ var MAX_NUMBER_OF_BYTE_U32 = 5; /** * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int * max = ceil(64/7) */ exports.MAX_NUMBER_OF_BYTE_U32 = MAX_NUMBER_OF_BYTE_U32; var MAX_NUMBER_OF_BYTE_U64 = 10; exports.MAX_NUMBER_OF_BYTE_U64 = MAX_NUMBER_OF_BYTE_U64; function decodeInt64(encodedBuffer, index) { return _leb.default.decodeInt64(encodedBuffer, index); } function decodeUInt64(encodedBuffer, index) { return _leb.default.decodeUInt64(encodedBuffer, index); } function decodeInt32(encodedBuffer, index) { return _leb.default.decodeInt32(encodedBuffer, index); } function decodeUInt32(encodedBuffer, index) { return _leb.default.decodeUInt32(encodedBuffer, index); } function encodeU32(v) { return _leb.default.encodeUInt32(v); } function encodeI32(v) { return _leb.default.encodeInt32(v); } function encodeI64(v) { return _leb.default.encodeInt64(v); } /***/ }), /***/ 39210: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; // Copyright 2012 The Obvious Corporation. /* * leb: LEB128 utilities. */ /* * Modules used */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; var _long = _interopRequireDefault(__webpack_require__(77960)); var bits = _interopRequireWildcard(__webpack_require__(83156)); var bufs = _interopRequireWildcard(__webpack_require__(84341)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* * Module variables */ /** The minimum possible 32-bit signed int. */ var MIN_INT32 = -0x80000000; /** The maximum possible 32-bit signed int. */ var MAX_INT32 = 0x7fffffff; /** The maximum possible 32-bit unsigned int. */ var MAX_UINT32 = 0xffffffff; /** The minimum possible 64-bit signed int. */ // const MIN_INT64 = -0x8000000000000000; /** * The maximum possible 64-bit signed int that is representable as a * JavaScript number. */ // const MAX_INT64 = 0x7ffffffffffffc00; /** * The maximum possible 64-bit unsigned int that is representable as a * JavaScript number. */ // const MAX_UINT64 = 0xfffffffffffff800; /* * Helper functions */ /** * Determines the number of bits required to encode the number * represented in the given buffer as a signed value. The buffer is * taken to represent a signed number in little-endian form. * * The number of bits to encode is the (zero-based) bit number of the * highest-order non-sign-matching bit, plus two. For example: * * 11111011 01110101 * high low * * The sign bit here is 1 (that is, it's a negative number). The highest * bit number that doesn't match the sign is bit #10 (where the lowest-order * bit is bit #0). So, we have to encode at least 12 bits total. * * As a special degenerate case, the numbers 0 and -1 each require just one bit. */ function signedBitCount(buffer) { return bits.highOrder(bits.getSign(buffer) ^ 1, buffer) + 2; } /** * Determines the number of bits required to encode the number * represented in the given buffer as an unsigned value. The buffer is * taken to represent an unsigned number in little-endian form. * * The number of bits to encode is the (zero-based) bit number of the * highest-order 1 bit, plus one. For example: * * 00011000 01010011 * high low * * The highest-order 1 bit here is bit #12 (where the lowest-order bit * is bit #0). So, we have to encode at least 13 bits total. * * As a special degenerate case, the number 0 requires 1 bit. */ function unsignedBitCount(buffer) { var result = bits.highOrder(1, buffer) + 1; return result ? result : 1; } /** * Common encoder for both signed and unsigned ints. This takes a * bigint-ish buffer, returning an LEB128-encoded buffer. */ function encodeBufferCommon(buffer, signed) { var signBit; var bitCount; if (signed) { signBit = bits.getSign(buffer); bitCount = signedBitCount(buffer); } else { signBit = 0; bitCount = unsignedBitCount(buffer); } var byteCount = Math.ceil(bitCount / 7); var result = bufs.alloc(byteCount); for (var i = 0; i < byteCount; i++) { var payload = bits.extract(buffer, i * 7, 7, signBit); result[i] = payload | 0x80; } // Mask off the top bit of the last byte, to indicate the end of the // encoding. result[byteCount - 1] &= 0x7f; return result; } /** * Gets the byte-length of the value encoded in the given buffer at * the given index. */ function encodedLength(encodedBuffer, index) { var result = 0; while (encodedBuffer[index + result] >= 0x80) { result++; } result++; // to account for the last byte if (index + result > encodedBuffer.length) {// FIXME(sven): seems to cause false positives // throw new Error("integer representation too long"); } return result; } /** * Common decoder for both signed and unsigned ints. This takes an * LEB128-encoded buffer, returning a bigint-ish buffer. */ function decodeBufferCommon(encodedBuffer, index, signed) { index = index === undefined ? 0 : index; var length = encodedLength(encodedBuffer, index); var bitLength = length * 7; var byteLength = Math.ceil(bitLength / 8); var result = bufs.alloc(byteLength); var outIndex = 0; while (length > 0) { bits.inject(result, outIndex, 7, encodedBuffer[index]); outIndex += 7; index++; length--; } var signBit; var signByte; if (signed) { // Sign-extend the last byte. var lastByte = result[byteLength - 1]; var endBit = outIndex % 8; if (endBit !== 0) { var shift = 32 - endBit; // 32 because JS bit ops work on 32-bit ints. lastByte = result[byteLength - 1] = lastByte << shift >> shift & 0xff; } signBit = lastByte >> 7; signByte = signBit * 0xff; } else { signBit = 0; signByte = 0; } // Slice off any superfluous bytes, that is, ones that add no meaningful // bits (because the value would be the same if they were removed). while (byteLength > 1 && result[byteLength - 1] === signByte && (!signed || result[byteLength - 2] >> 7 === signBit)) { byteLength--; } result = bufs.resize(result, byteLength); return { value: result, nextIndex: index }; } /* * Exported bindings */ function encodeIntBuffer(buffer) { return encodeBufferCommon(buffer, true); } function decodeIntBuffer(encodedBuffer, index) { return decodeBufferCommon(encodedBuffer, index, true); } function encodeInt32(num) { var buf = bufs.alloc(4); buf.writeInt32LE(num, 0); var result = encodeIntBuffer(buf); bufs.free(buf); return result; } function decodeInt32(encodedBuffer, index) { var result = decodeIntBuffer(encodedBuffer, index); var parsed = bufs.readInt(result.value); var value = parsed.value; bufs.free(result.value); if (value < MIN_INT32 || value > MAX_INT32) { throw new Error("integer too large"); } return { value: value, nextIndex: result.nextIndex }; } function encodeInt64(num) { var buf = bufs.alloc(8); bufs.writeInt64(num, buf); var result = encodeIntBuffer(buf); bufs.free(buf); return result; } function decodeInt64(encodedBuffer, index) { var result = decodeIntBuffer(encodedBuffer, index); var value = _long.default.fromBytesLE(result.value, false); bufs.free(result.value); return { value: value, nextIndex: result.nextIndex, lossy: false }; } function encodeUIntBuffer(buffer) { return encodeBufferCommon(buffer, false); } function decodeUIntBuffer(encodedBuffer, index) { return decodeBufferCommon(encodedBuffer, index, false); } function encodeUInt32(num) { var buf = bufs.alloc(4); buf.writeUInt32LE(num, 0); var result = encodeUIntBuffer(buf); bufs.free(buf); return result; } function decodeUInt32(encodedBuffer, index) { var result = decodeUIntBuffer(encodedBuffer, index); var parsed = bufs.readUInt(result.value); var value = parsed.value; bufs.free(result.value); if (value > MAX_UINT32) { throw new Error("integer too large"); } return { value: value, nextIndex: result.nextIndex }; } function encodeUInt64(num) { var buf = bufs.alloc(8); bufs.writeUInt64(num, buf); var result = encodeUIntBuffer(buf); bufs.free(buf); return result; } function decodeUInt64(encodedBuffer, index) { var result = decodeUIntBuffer(encodedBuffer, index); var value = _long.default.fromBytesLE(result.value, true); bufs.free(result.value); return { value: value, nextIndex: result.nextIndex, lossy: false }; } var _default = { decodeInt32: decodeInt32, decodeInt64: decodeInt64, decodeIntBuffer: decodeIntBuffer, decodeUInt32: decodeUInt32, decodeUInt64: decodeUInt64, decodeUIntBuffer: decodeUIntBuffer, encodeInt32: encodeInt32, encodeInt64: encodeInt64, encodeIntBuffer: encodeIntBuffer, encodeUInt32: encodeUInt32, encodeUInt64: encodeUInt64, encodeUIntBuffer: encodeUIntBuffer }; exports.default = _default; /***/ }), /***/ 63202: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decode = decode; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } function con(b) { if ((b & 0xc0) === 0x80) { return b & 0x3f; } else { throw new Error("invalid UTF-8 encoding"); } } function code(min, n) { if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) { throw new Error("invalid UTF-8 encoding"); } else { return n; } } function decode(bytes) { return _decode(bytes).map(function (x) { return String.fromCharCode(x); }).join(""); } function _decode(bytes) { if (bytes.length === 0) { return []; } /** * 1 byte */ { var _bytes = _toArray(bytes), b1 = _bytes[0], bs = _bytes.slice(1); if (b1 < 0x80) { return [code(0x0, b1)].concat(_toConsumableArray(_decode(bs))); } if (b1 < 0xc0) { throw new Error("invalid UTF-8 encoding"); } } /** * 2 bytes */ { var _bytes2 = _toArray(bytes), _b = _bytes2[0], b2 = _bytes2[1], _bs = _bytes2.slice(2); if (_b < 0xe0) { return [code(0x80, ((_b & 0x1f) << 6) + con(b2))].concat(_toConsumableArray(_decode(_bs))); } } /** * 3 bytes */ { var _bytes3 = _toArray(bytes), _b2 = _bytes3[0], _b3 = _bytes3[1], b3 = _bytes3[2], _bs2 = _bytes3.slice(3); if (_b2 < 0xf0) { return [code(0x800, ((_b2 & 0x0f) << 12) + (con(_b3) << 6) + con(b3))].concat(_toConsumableArray(_decode(_bs2))); } } /** * 4 bytes */ { var _bytes4 = _toArray(bytes), _b4 = _bytes4[0], _b5 = _bytes4[1], _b6 = _bytes4[2], b4 = _bytes4[3], _bs3 = _bytes4.slice(4); if (_b4 < 0xf8) { return [code(0x10000, (((_b4 & 0x07) << 18) + con(_b5) << 12) + (con(_b6) << 6) + con(b4))].concat(_toConsumableArray(_decode(_bs3))); } } throw new Error("invalid UTF-8 encoding"); } /***/ }), /***/ 71812: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encode = encode; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } function con(n) { return 0x80 | n & 0x3f; } function encode(str) { var arr = str.split("").map(function (x) { return x.charCodeAt(0); }); return _encode(arr); } function _encode(arr) { if (arr.length === 0) { return []; } var _arr = _toArray(arr), n = _arr[0], ns = _arr.slice(1); if (n < 0) { throw new Error("utf8"); } if (n < 0x80) { return [n].concat(_toConsumableArray(_encode(ns))); } if (n < 0x800) { return [0xc0 | n >>> 6, con(n)].concat(_toConsumableArray(_encode(ns))); } if (n < 0x10000) { return [0xe0 | n >>> 12, con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); } if (n < 0x110000) { return [0xf0 | n >>> 18, con(n >>> 12), con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns))); } throw new Error("utf8"); } /***/ }), /***/ 17715: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "decode", ({ enumerable: true, get: function get() { return _decoder.decode; } })); Object.defineProperty(exports, "encode", ({ enumerable: true, get: function get() { return _encoder.encode; } })); var _decoder = __webpack_require__(63202); var _encoder = __webpack_require__(71812); /***/ }), /***/ 56550: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.applyOperations = applyOperations; var _wasmGen = __webpack_require__(62394); var _encoder = __webpack_require__(94261); var _ast = __webpack_require__(98688); var _helperWasmSection = __webpack_require__(37427); var _helperBuffer = __webpack_require__(57827); var _helperWasmBytecode = __webpack_require__(97527); function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } function shiftLocNodeByDelta(node, delta) { (0, _ast.assertHasLoc)(node); // $FlowIgnore: assertHasLoc ensures that node.loc.start.column += delta; // $FlowIgnore: assertHasLoc ensures that node.loc.end.column += delta; } function applyUpdate(ast, uint8Buffer, _ref) { var _ref2 = _slicedToArray(_ref, 2), oldNode = _ref2[0], newNode = _ref2[1]; var deltaElements = 0; (0, _ast.assertHasLoc)(oldNode); var sectionName = (0, _helperWasmBytecode.getSectionForNode)(newNode); var replacementByteArray = (0, _wasmGen.encodeNode)(newNode); /** * Replace new node as bytes */ uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that oldNode.loc.start.column, // $FlowIgnore: assertHasLoc ensures that oldNode.loc.end.column, replacementByteArray); /** * Update function body size if needed */ if (sectionName === "code") { // Find the parent func (0, _ast.traverse)(ast, { Func: function Func(_ref3) { var node = _ref3.node; var funcHasThisIntr = node.body.find(function (n) { return n === newNode; }) !== undefined; // Update func's body size if needed if (funcHasThisIntr === true) { // These are the old functions locations informations (0, _ast.assertHasLoc)(node); var oldNodeSize = (0, _wasmGen.encodeNode)(oldNode).length; var bodySizeDeltaBytes = replacementByteArray.length - oldNodeSize; if (bodySizeDeltaBytes !== 0) { var newValue = node.metadata.bodySize + bodySizeDeltaBytes; var newByteArray = (0, _encoder.encodeU32)(newValue); // function body size byte // FIXME(sven): only handles one byte u32 var start = node.loc.start.column; var end = start + 1; uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray); } } } }); } /** * Update section size */ var deltaBytes = replacementByteArray.length - ( // $FlowIgnore: assertHasLoc ensures that oldNode.loc.end.column - oldNode.loc.start.column); // Init location informations newNode.loc = { start: { line: -1, column: -1 }, end: { line: -1, column: -1 } }; // Update new node end position // $FlowIgnore: assertHasLoc ensures that newNode.loc.start.column = oldNode.loc.start.column; // $FlowIgnore: assertHasLoc ensures that newNode.loc.end.column = // $FlowIgnore: assertHasLoc ensures that oldNode.loc.start.column + replacementByteArray.length; return { uint8Buffer: uint8Buffer, deltaBytes: deltaBytes, deltaElements: deltaElements }; } function applyDelete(ast, uint8Buffer, node) { var deltaElements = -1; // since we removed an element (0, _ast.assertHasLoc)(node); var sectionName = (0, _helperWasmBytecode.getSectionForNode)(node); if (sectionName === "start") { var sectionMetadata = (0, _ast.getSectionMetadata)(ast, "start"); /** * The start section only contains one element, * we need to remove the whole section */ uint8Buffer = (0, _helperWasmSection.removeSections)(ast, uint8Buffer, "start"); var _deltaBytes = -(sectionMetadata.size.value + 1); /* section id */ return { uint8Buffer: uint8Buffer, deltaBytes: _deltaBytes, deltaElements: deltaElements }; } // replacement is nothing var replacement = []; uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, // $FlowIgnore: assertHasLoc ensures that node.loc.start.column, // $FlowIgnore: assertHasLoc ensures that node.loc.end.column, replacement); /** * Update section */ // $FlowIgnore: assertHasLoc ensures that var deltaBytes = -(node.loc.end.column - node.loc.start.column); return { uint8Buffer: uint8Buffer, deltaBytes: deltaBytes, deltaElements: deltaElements }; } function applyAdd(ast, uint8Buffer, node) { var deltaElements = +1; // since we added an element var sectionName = (0, _helperWasmBytecode.getSectionForNode)(node); var sectionMetadata = (0, _ast.getSectionMetadata)(ast, sectionName); // Section doesn't exists, we create an empty one if (typeof sectionMetadata === "undefined") { var res = (0, _helperWasmSection.createEmptySection)(ast, uint8Buffer, sectionName); uint8Buffer = res.uint8Buffer; sectionMetadata = res.sectionMetadata; } /** * check that the expressions were ended */ if ((0, _ast.isFunc)(node)) { // $FlowIgnore var body = node.body; if (body.length === 0 || body[body.length - 1].id !== "end") { throw new Error("expressions must be ended"); } } if ((0, _ast.isGlobal)(node)) { // $FlowIgnore var body = node.init; if (body.length === 0 || body[body.length - 1].id !== "end") { throw new Error("expressions must be ended"); } } /** * Add nodes */ var newByteArray = (0, _wasmGen.encodeNode)(node); // The size of the section doesn't include the storage of the size itself // we need to manually add it here var start = (0, _ast.getEndOfSection)(sectionMetadata); var end = start; /** * Update section */ var deltaBytes = newByteArray.length; uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray); node.loc = { start: { line: -1, column: start }, end: { line: -1, column: start + deltaBytes } }; // for func add the additional metadata in the AST if (node.type === "Func") { // the size is the first byte // FIXME(sven): handle LEB128 correctly here var bodySize = newByteArray[0]; node.metadata = { bodySize: bodySize }; } if (node.type !== "IndexInFuncSection") { (0, _ast.orderedInsertNode)(ast.body[0], node); } return { uint8Buffer: uint8Buffer, deltaBytes: deltaBytes, deltaElements: deltaElements }; } function applyOperations(ast, uint8Buffer, ops) { ops.forEach(function (op) { var state; var sectionName; switch (op.kind) { case "update": state = applyUpdate(ast, uint8Buffer, [op.oldNode, op.node]); sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); break; case "delete": state = applyDelete(ast, uint8Buffer, op.node); sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); break; case "add": state = applyAdd(ast, uint8Buffer, op.node); sectionName = (0, _helperWasmBytecode.getSectionForNode)(op.node); break; default: throw new Error("Unknown operation"); } /** * Resize section vec size. * If the length of the LEB-encoded size changes, this can change * the byte length of the section and the offset for nodes in the * section. So we do this first before resizing section byte size * or shifting following operations' nodes. */ if (state.deltaElements !== 0 && sectionName !== "start") { var oldBufferLength = state.uint8Buffer.length; state.uint8Buffer = (0, _helperWasmSection.resizeSectionVecSize)(ast, state.uint8Buffer, sectionName, state.deltaElements); // Infer bytes added/removed by comparing buffer lengths state.deltaBytes += state.uint8Buffer.length - oldBufferLength; } /** * Resize section byte size. * If the length of the LEB-encoded size changes, this can change * the offset for nodes in the section. So we do this before * shifting following operations' nodes. */ if (state.deltaBytes !== 0 && sectionName !== "start") { var _oldBufferLength = state.uint8Buffer.length; state.uint8Buffer = (0, _helperWasmSection.resizeSectionByteSize)(ast, state.uint8Buffer, sectionName, state.deltaBytes); // Infer bytes added/removed by comparing buffer lengths state.deltaBytes += state.uint8Buffer.length - _oldBufferLength; } /** * Shift following operation's nodes */ if (state.deltaBytes !== 0) { ops.forEach(function (op) { // We don't need to handle add ops, they are positioning independent switch (op.kind) { case "update": shiftLocNodeByDelta(op.oldNode, state.deltaBytes); break; case "delete": shiftLocNodeByDelta(op.node, state.deltaBytes); break; } }); } uint8Buffer = state.uint8Buffer; }); return uint8Buffer; } /***/ }), /***/ 65584: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.edit = edit; exports.editWithAST = editWithAST; exports.add = add; exports.addWithAST = addWithAST; var _wasmParser = __webpack_require__(8062); var _ast = __webpack_require__(98688); var _clone = __webpack_require__(95373); var _wasmOpt = __webpack_require__(46421); var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(97527)); var _apply = __webpack_require__(56550); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function hashNode(node) { return JSON.stringify(node); } function preprocess(ab) { var optBin = (0, _wasmOpt.shrinkPaddedLEB128)(new Uint8Array(ab)); return optBin.buffer; } function sortBySectionOrder(nodes) { var originalOrder = new Map(); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _node = _step.value; originalOrder.set(_node, originalOrder.size); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } nodes.sort(function (a, b) { var sectionA = (0, _helperWasmBytecode.getSectionForNode)(a); var sectionB = (0, _helperWasmBytecode.getSectionForNode)(b); var aId = _helperWasmBytecode.default.sections[sectionA]; var bId = _helperWasmBytecode.default.sections[sectionB]; if (typeof aId !== "number" || typeof bId !== "number") { throw new Error("Section id not found"); } if (aId === bId) { // $FlowIgnore originalOrder is filled for all nodes return originalOrder.get(a) - originalOrder.get(b); } return aId - bId; }); } function edit(ab, visitors) { ab = preprocess(ab); var ast = (0, _wasmParser.decode)(ab); return editWithAST(ast, ab, visitors); } function editWithAST(ast, ab, visitors) { var operations = []; var uint8Buffer = new Uint8Array(ab); var nodeBefore; function before(type, path) { nodeBefore = (0, _clone.cloneNode)(path.node); } function after(type, path) { if (path.node._deleted === true) { operations.push({ kind: "delete", node: path.node }); // $FlowIgnore } else if (hashNode(nodeBefore) !== hashNode(path.node)) { operations.push({ kind: "update", oldNode: nodeBefore, node: path.node }); } } (0, _ast.traverse)(ast, visitors, before, after); uint8Buffer = (0, _apply.applyOperations)(ast, uint8Buffer, operations); return uint8Buffer.buffer; } function add(ab, newNodes) { ab = preprocess(ab); var ast = (0, _wasmParser.decode)(ab); return addWithAST(ast, ab, newNodes); } function addWithAST(ast, ab, newNodes) { // Sort nodes by insertion order sortBySectionOrder(newNodes); var uint8Buffer = new Uint8Array(ab); // Map node into operations var operations = newNodes.map(function (n) { return { kind: "add", node: n }; }); uint8Buffer = (0, _apply.applyOperations)(ast, uint8Buffer, operations); return uint8Buffer.buffer; } /***/ }), /***/ 94261: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encodeVersion = encodeVersion; exports.encodeHeader = encodeHeader; exports.encodeU32 = encodeU32; exports.encodeI32 = encodeI32; exports.encodeI64 = encodeI64; exports.encodeVec = encodeVec; exports.encodeValtype = encodeValtype; exports.encodeMutability = encodeMutability; exports.encodeUTF8Vec = encodeUTF8Vec; exports.encodeLimits = encodeLimits; exports.encodeModuleImport = encodeModuleImport; exports.encodeSectionMetadata = encodeSectionMetadata; exports.encodeCallInstruction = encodeCallInstruction; exports.encodeCallIndirectInstruction = encodeCallIndirectInstruction; exports.encodeModuleExport = encodeModuleExport; exports.encodeTypeInstruction = encodeTypeInstruction; exports.encodeInstr = encodeInstr; exports.encodeStringLiteral = encodeStringLiteral; exports.encodeGlobal = encodeGlobal; exports.encodeFuncBody = encodeFuncBody; exports.encodeIndexInFuncSection = encodeIndexInFuncSection; exports.encodeElem = encodeElem; var leb = _interopRequireWildcard(__webpack_require__(20942)); var ieee754 = _interopRequireWildcard(__webpack_require__(23408)); var utf8 = _interopRequireWildcard(__webpack_require__(17715)); var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(97527)); var _index = __webpack_require__(62394); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function assertNotIdentifierNode(n) { if (n.type === "Identifier") { throw new Error("Unsupported node Identifier"); } } function encodeVersion(v) { var bytes = _helperWasmBytecode.default.moduleVersion; bytes[0] = v; return bytes; } function encodeHeader() { return _helperWasmBytecode.default.magicModuleHeader; } function encodeU32(v) { var uint8view = new Uint8Array(leb.encodeU32(v)); var array = _toConsumableArray(uint8view); return array; } function encodeI32(v) { var uint8view = new Uint8Array(leb.encodeI32(v)); var array = _toConsumableArray(uint8view); return array; } function encodeI64(v) { var uint8view = new Uint8Array(leb.encodeI64(v)); var array = _toConsumableArray(uint8view); return array; } function encodeVec(elements) { var size = encodeU32(elements.length); return _toConsumableArray(size).concat(_toConsumableArray(elements)); } function encodeValtype(v) { var byte = _helperWasmBytecode.default.valtypesByString[v]; if (typeof byte === "undefined") { throw new Error("Unknown valtype: " + v); } return parseInt(byte, 10); } function encodeMutability(v) { var byte = _helperWasmBytecode.default.globalTypesByString[v]; if (typeof byte === "undefined") { throw new Error("Unknown mutability: " + v); } return parseInt(byte, 10); } function encodeUTF8Vec(str) { return encodeVec(utf8.encode(str)); } function encodeLimits(n) { var out = []; if (typeof n.max === "number") { out.push(0x01); out.push.apply(out, _toConsumableArray(encodeU32(n.min))); // $FlowIgnore: ensured by the typeof out.push.apply(out, _toConsumableArray(encodeU32(n.max))); } else { out.push(0x00); out.push.apply(out, _toConsumableArray(encodeU32(n.min))); } return out; } function encodeModuleImport(n) { var out = []; out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.module))); out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); switch (n.descr.type) { case "GlobalType": { out.push(0x03); // $FlowIgnore: GlobalType ensure that these props exists out.push(encodeValtype(n.descr.valtype)); // $FlowIgnore: GlobalType ensure that these props exists out.push(encodeMutability(n.descr.mutability)); break; } case "Memory": { out.push(0x02); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); break; } case "Table": { out.push(0x01); out.push(0x70); // element type // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits))); break; } case "FuncImportDescr": { out.push(0x00); // $FlowIgnore assertNotIdentifierNode(n.descr.id); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); break; } default: throw new Error("Unsupport operation: encode module import of type: " + n.descr.type); } return out; } function encodeSectionMetadata(n) { var out = []; var sectionId = _helperWasmBytecode.default.sections[n.section]; if (typeof sectionId === "undefined") { throw new Error("Unknown section: " + n.section); } if (n.section === "start") { /** * This is not implemented yet because it's a special case which * doesn't have a vector in its section. */ throw new Error("Unsupported section encoding of type start"); } out.push(sectionId); out.push.apply(out, _toConsumableArray(encodeU32(n.size.value))); out.push.apply(out, _toConsumableArray(encodeU32(n.vectorOfSize.value))); return out; } function encodeCallInstruction(n) { var out = []; assertNotIdentifierNode(n.index); out.push(0x10); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); return out; } function encodeCallIndirectInstruction(n) { var out = []; // $FlowIgnore assertNotIdentifierNode(n.index); out.push(0x11); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); // add a reserved byte out.push(0x00); return out; } function encodeModuleExport(n) { var out = []; assertNotIdentifierNode(n.descr.id); var exportTypeByteString = _helperWasmBytecode.default.exportTypesByName[n.descr.exportType]; if (typeof exportTypeByteString === "undefined") { throw new Error("Unknown export of type: " + n.descr.exportType); } var exportTypeByte = parseInt(exportTypeByteString, 10); out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name))); out.push(exportTypeByte); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value))); return out; } function encodeTypeInstruction(n) { var out = [0x60]; var params = n.functype.params.map(function (x) { return x.valtype; }).map(encodeValtype); var results = n.functype.results.map(encodeValtype); out.push.apply(out, _toConsumableArray(encodeVec(params))); out.push.apply(out, _toConsumableArray(encodeVec(results))); return out; } function encodeInstr(n) { var out = []; var instructionName = n.id; if (typeof n.object === "string") { instructionName = "".concat(n.object, ".").concat(String(n.id)); } var byteString = _helperWasmBytecode.default.symbolsByName[instructionName]; if (typeof byteString === "undefined") { throw new Error("encodeInstr: unknown instruction " + JSON.stringify(instructionName)); } var byte = parseInt(byteString, 10); out.push(byte); if (n.args) { n.args.forEach(function (arg) { var encoder = encodeU32; // find correct encoder if (n.object === "i32") { encoder = encodeI32; } if (n.object === "i64") { encoder = encodeI64; } if (n.object === "f32") { encoder = ieee754.encodeF32; } if (n.object === "f64") { encoder = ieee754.encodeF64; } if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") { // $FlowIgnore out.push.apply(out, _toConsumableArray(encoder(arg.value))); } else { throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type)); } }); } return out; } function encodeExpr(instrs) { var out = []; instrs.forEach(function (instr) { // $FlowIgnore var n = (0, _index.encodeNode)(instr); out.push.apply(out, _toConsumableArray(n)); }); return out; } function encodeStringLiteral(n) { return encodeUTF8Vec(n.value); } function encodeGlobal(n) { var out = []; var _n$globalType = n.globalType, valtype = _n$globalType.valtype, mutability = _n$globalType.mutability; out.push(encodeValtype(valtype)); out.push(encodeMutability(mutability)); out.push.apply(out, _toConsumableArray(encodeExpr(n.init))); return out; } function encodeFuncBody(n) { var out = []; out.push(-1); // temporary function body size // FIXME(sven): get the func locals? var localBytes = encodeVec([]); out.push.apply(out, _toConsumableArray(localBytes)); var funcBodyBytes = encodeExpr(n.body); out[0] = funcBodyBytes.length + localBytes.length; out.push.apply(out, _toConsumableArray(funcBodyBytes)); return out; } function encodeIndexInFuncSection(n) { assertNotIdentifierNode(n.index); // $FlowIgnore return encodeU32(n.index.value); } function encodeElem(n) { var out = []; assertNotIdentifierNode(n.table); // $FlowIgnore out.push.apply(out, _toConsumableArray(encodeU32(n.table.value))); out.push.apply(out, _toConsumableArray(encodeExpr(n.offset))); // $FlowIgnore var funcs = n.funcs.reduce(function (acc, x) { return _toConsumableArray(acc).concat(_toConsumableArray(encodeU32(x.value))); }, []); out.push.apply(out, _toConsumableArray(encodeVec(funcs))); return out; } /***/ }), /***/ 62394: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encodeNode = encodeNode; exports.encodeU32 = void 0; var encoder = _interopRequireWildcard(__webpack_require__(94261)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function encodeNode(n) { switch (n.type) { case "ModuleImport": // $FlowIgnore: ModuleImport ensure that the node is well formated return encoder.encodeModuleImport(n); case "SectionMetadata": // $FlowIgnore: SectionMetadata ensure that the node is well formated return encoder.encodeSectionMetadata(n); case "CallInstruction": // $FlowIgnore: SectionMetadata ensure that the node is well formated return encoder.encodeCallInstruction(n); case "CallIndirectInstruction": // $FlowIgnore: SectionMetadata ensure that the node is well formated return encoder.encodeCallIndirectInstruction(n); case "TypeInstruction": return encoder.encodeTypeInstruction(n); case "Instr": // $FlowIgnore return encoder.encodeInstr(n); case "ModuleExport": // $FlowIgnore: SectionMetadata ensure that the node is well formated return encoder.encodeModuleExport(n); case "Global": // $FlowIgnore return encoder.encodeGlobal(n); case "Func": return encoder.encodeFuncBody(n); case "IndexInFuncSection": return encoder.encodeIndexInFuncSection(n); case "StringLiteral": return encoder.encodeStringLiteral(n); case "Elem": return encoder.encodeElem(n); default: throw new Error("Unsupported encoding for node of type: " + JSON.stringify(n.type)); } } var encodeU32 = encoder.encodeU32; exports.encodeU32 = encodeU32; /***/ }), /***/ 46421: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; var _wasmParser = __webpack_require__(8062); var _leb = __webpack_require__(15829); function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var OptimizerError = /*#__PURE__*/ function (_Error) { _inherits(OptimizerError, _Error); function OptimizerError(name, initalError) { var _this; _classCallCheck(this, OptimizerError); _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message)); _this.stack = initalError.stack; return _this; } return OptimizerError; }(Error); var decoderOpts = { ignoreCodeSection: true, ignoreDataSection: true }; function shrinkPaddedLEB128(uint8Buffer) { try { var ast = (0, _wasmParser.decode)(uint8Buffer.buffer, decoderOpts); return (0, _leb.shrinkPaddedLEB128)(ast, uint8Buffer); } catch (e) { throw new OptimizerError("shrinkPaddedLEB128", e); } } /***/ }), /***/ 15829: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; var _ast = __webpack_require__(98688); var _encoder = __webpack_require__(94261); var _helperBuffer = __webpack_require__(57827); function shiftFollowingSections(ast, _ref, deltaInSizeEncoding) { var section = _ref.section; // Once we hit our section every that is after needs to be shifted by the delta var encounteredSection = false; (0, _ast.traverse)(ast, { SectionMetadata: function SectionMetadata(path) { if (path.node.section === section) { encounteredSection = true; return; } if (encounteredSection === true) { (0, _ast.shiftSection)(ast, path.node, deltaInSizeEncoding); } } }); } function shrinkPaddedLEB128(ast, uint8Buffer) { (0, _ast.traverse)(ast, { SectionMetadata: function SectionMetadata(_ref2) { var node = _ref2.node; /** * Section size */ { var newu32Encoded = (0, _encoder.encodeU32)(node.size.value); var newu32EncodedLen = newu32Encoded.length; var start = node.size.loc.start.column; var end = node.size.loc.end.column; var oldu32EncodedLen = end - start; if (newu32EncodedLen !== oldu32EncodedLen) { var deltaInSizeEncoding = oldu32EncodedLen - newu32EncodedLen; uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newu32Encoded); shiftFollowingSections(ast, node, -deltaInSizeEncoding); } } } }); return uint8Buffer; } /***/ }), /***/ 72856: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decode = decode; var _helperApiError = __webpack_require__(36194); var ieee754 = _interopRequireWildcard(__webpack_require__(23408)); var utf8 = _interopRequireWildcard(__webpack_require__(17715)); var t = _interopRequireWildcard(__webpack_require__(98688)); var _leb = __webpack_require__(20942); var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(97527)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function toHex(n) { return "0x" + Number(n).toString(16); } function byteArrayEq(l, r) { if (l.length !== r.length) { return false; } for (var i = 0; i < l.length; i++) { if (l[i] !== r[i]) { return false; } } return true; } function decode(ab, opts) { var buf = new Uint8Array(ab); var getUniqueName = t.getUniqueNameGenerator(); var offset = 0; function getPosition() { return { line: -1, column: offset }; } function dump(b, msg) { if (opts.dump === false) return; var pad = "\t\t\t\t\t\t\t\t\t\t"; var str = ""; if (b.length < 5) { str = b.map(toHex).join(" "); } else { str = "..."; } console.log(toHex(offset) + ":\t", str, pad, ";", msg); } function dumpSep(msg) { if (opts.dump === false) return; console.log(";", msg); } /** * TODO(sven): we can atually use a same structure * we are adding incrementally new features */ var state = { elementsInFuncSection: [], elementsInExportSection: [], elementsInCodeSection: [], /** * Decode memory from: * - Memory section */ memoriesInModule: [], /** * Decoded types from: * - Type section */ typesInModule: [], /** * Decoded functions from: * - Function section * - Import section */ functionsInModule: [], /** * Decoded tables from: * - Table section */ tablesInModule: [], /** * Decoded globals from: * - Global section */ globalsInModule: [] }; function isEOF() { return offset >= buf.length; } function eatBytes(n) { offset = offset + n; } function readBytesAtOffset(_offset, numberOfBytes) { var arr = []; for (var i = 0; i < numberOfBytes; i++) { arr.push(buf[_offset + i]); } return arr; } function readBytes(numberOfBytes) { return readBytesAtOffset(offset, numberOfBytes); } function readF64() { var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F64); var value = ieee754.decodeF64(bytes); if (Math.sign(value) * value === Infinity) { return { value: Math.sign(value), inf: true, nextIndex: ieee754.NUMBER_OF_BYTE_F64 }; } if (isNaN(value)) { var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; var mantissa = 0; for (var i = 0; i < bytes.length - 2; ++i) { mantissa += bytes[i] * Math.pow(256, i); } mantissa += bytes[bytes.length - 2] % 16 * Math.pow(256, bytes.length - 2); return { value: sign * mantissa, nan: true, nextIndex: ieee754.NUMBER_OF_BYTE_F64 }; } return { value: value, nextIndex: ieee754.NUMBER_OF_BYTE_F64 }; } function readF32() { var bytes = readBytes(ieee754.NUMBER_OF_BYTE_F32); var value = ieee754.decodeF32(bytes); if (Math.sign(value) * value === Infinity) { return { value: Math.sign(value), inf: true, nextIndex: ieee754.NUMBER_OF_BYTE_F32 }; } if (isNaN(value)) { var sign = bytes[bytes.length - 1] >> 7 ? -1 : 1; var mantissa = 0; for (var i = 0; i < bytes.length - 2; ++i) { mantissa += bytes[i] * Math.pow(256, i); } mantissa += bytes[bytes.length - 2] % 128 * Math.pow(256, bytes.length - 2); return { value: sign * mantissa, nan: true, nextIndex: ieee754.NUMBER_OF_BYTE_F32 }; } return { value: value, nextIndex: ieee754.NUMBER_OF_BYTE_F32 }; } function readUTF8String() { var lenu32 = readU32(); // Don't eat any bytes. Instead, peek ahead of the current offset using // readBytesAtOffset below. This keeps readUTF8String neutral with respect // to the current offset, just like the other readX functions. var strlen = lenu32.value; dump([strlen], "string length"); var bytes = readBytesAtOffset(offset + lenu32.nextIndex, strlen); var value = utf8.decode(bytes); return { value: value, nextIndex: strlen + lenu32.nextIndex }; } /** * Decode an unsigned 32bits integer * * The length will be handled by the leb librairy, we pass the max number of * byte. */ function readU32() { var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U32); var buffer = Buffer.from(bytes); return (0, _leb.decodeUInt32)(buffer); } function readVaruint32() { // where 32 bits = max 4 bytes var bytes = readBytes(4); var buffer = Buffer.from(bytes); return (0, _leb.decodeUInt32)(buffer); } function readVaruint7() { // where 7 bits = max 1 bytes var bytes = readBytes(1); var buffer = Buffer.from(bytes); return (0, _leb.decodeUInt32)(buffer); } /** * Decode a signed 32bits interger */ function read32() { var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U32); var buffer = Buffer.from(bytes); return (0, _leb.decodeInt32)(buffer); } /** * Decode a signed 64bits integer */ function read64() { var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U64); var buffer = Buffer.from(bytes); return (0, _leb.decodeInt64)(buffer); } function readU64() { var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U64); var buffer = Buffer.from(bytes); return (0, _leb.decodeUInt64)(buffer); } function readByte() { return readBytes(1)[0]; } function parseModuleHeader() { if (isEOF() === true || offset + 4 > buf.length) { throw new Error("unexpected end"); } var header = readBytes(4); if (byteArrayEq(_helperWasmBytecode.default.magicModuleHeader, header) === false) { throw new _helperApiError.CompileError("magic header not detected"); } dump(header, "wasm magic header"); eatBytes(4); } function parseVersion() { if (isEOF() === true || offset + 4 > buf.length) { throw new Error("unexpected end"); } var version = readBytes(4); if (byteArrayEq(_helperWasmBytecode.default.moduleVersion, version) === false) { throw new _helperApiError.CompileError("unknown binary version"); } dump(version, "wasm version"); eatBytes(4); } function parseVec(cast) { var u32 = readU32(); var length = u32.value; eatBytes(u32.nextIndex); dump([length], "number"); if (length === 0) { return []; } var elements = []; for (var i = 0; i < length; i++) { var byte = readByte(); eatBytes(1); var value = cast(byte); dump([byte], value); if (typeof value === "undefined") { throw new _helperApiError.CompileError("Internal failure: parseVec could not cast the value"); } elements.push(value); } return elements; } // Type section // https://webassembly.github.io/spec/binary/modules.html#binary-typesec function parseTypeSection(numberOfTypes) { var typeInstructionNodes = []; dump([numberOfTypes], "num types"); for (var i = 0; i < numberOfTypes; i++) { var _startLoc = getPosition(); dumpSep("type " + i); var type = readByte(); eatBytes(1); if (type == _helperWasmBytecode.default.types.func) { dump([type], "func"); var paramValtypes = parseVec(function (b) { return _helperWasmBytecode.default.valtypes[b]; }); var params = paramValtypes.map(function (v) { return t.funcParam( /*valtype*/ v); }); var result = parseVec(function (b) { return _helperWasmBytecode.default.valtypes[b]; }); typeInstructionNodes.push(function () { var endLoc = getPosition(); return t.withLoc(t.typeInstruction(undefined, t.signature(params, result)), endLoc, _startLoc); }()); state.typesInModule.push({ params: params, result: result }); } else { throw new Error("Unsupported type: " + toHex(type)); } } return typeInstructionNodes; } // Import section // https://webassembly.github.io/spec/binary/modules.html#binary-importsec function parseImportSection(numberOfImports) { var imports = []; for (var i = 0; i < numberOfImports; i++) { dumpSep("import header " + i); var _startLoc2 = getPosition(); /** * Module name */ var moduleName = readUTF8String(); eatBytes(moduleName.nextIndex); dump([], "module name (".concat(moduleName.value, ")")); /** * Name */ var name = readUTF8String(); eatBytes(name.nextIndex); dump([], "name (".concat(name.value, ")")); /** * Import descr */ var descrTypeByte = readByte(); eatBytes(1); var descrType = _helperWasmBytecode.default.importTypes[descrTypeByte]; dump([descrTypeByte], "import kind"); if (typeof descrType === "undefined") { throw new _helperApiError.CompileError("Unknown import description type: " + toHex(descrTypeByte)); } var importDescr = void 0; if (descrType === "func") { var indexU32 = readU32(); var typeindex = indexU32.value; eatBytes(indexU32.nextIndex); dump([typeindex], "type index"); var signature = state.typesInModule[typeindex]; if (typeof signature === "undefined") { throw new _helperApiError.CompileError("function signature not found (".concat(typeindex, ")")); } var id = getUniqueName("func"); importDescr = t.funcImportDescr(id, t.signature(signature.params, signature.result)); state.functionsInModule.push({ id: t.identifier(name.value), signature: signature, isExternal: true }); } else if (descrType === "global") { importDescr = parseGlobalType(); var globalNode = t.global(importDescr, []); state.globalsInModule.push(globalNode); } else if (descrType === "table") { importDescr = parseTableType(i); } else if (descrType === "mem") { var memoryNode = parseMemoryType(0); state.memoriesInModule.push(memoryNode); importDescr = memoryNode; } else { throw new _helperApiError.CompileError("Unsupported import of type: " + descrType); } imports.push(function () { var endLoc = getPosition(); return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2); }()); } return imports; } // Function section // https://webassembly.github.io/spec/binary/modules.html#function-section function parseFuncSection(numberOfFunctions) { dump([numberOfFunctions], "num funcs"); for (var i = 0; i < numberOfFunctions; i++) { var indexU32 = readU32(); var typeindex = indexU32.value; eatBytes(indexU32.nextIndex); dump([typeindex], "type index"); var signature = state.typesInModule[typeindex]; if (typeof signature === "undefined") { throw new _helperApiError.CompileError("function signature not found (".concat(typeindex, ")")); } // preserve anonymous, a name might be resolved later var id = t.withRaw(t.identifier(getUniqueName("func")), ""); state.functionsInModule.push({ id: id, signature: signature, isExternal: false }); } } // Export section // https://webassembly.github.io/spec/binary/modules.html#export-section function parseExportSection(numberOfExport) { dump([numberOfExport], "num exports"); // Parse vector of exports for (var i = 0; i < numberOfExport; i++) { var _startLoc3 = getPosition(); /** * Name */ var name = readUTF8String(); eatBytes(name.nextIndex); dump([], "export name (".concat(name.value, ")")); /** * exportdescr */ var typeIndex = readByte(); eatBytes(1); dump([typeIndex], "export kind"); var indexu32 = readU32(); var index = indexu32.value; eatBytes(indexu32.nextIndex); dump([index], "export index"); var id = void 0, signature = void 0; if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Func") { var func = state.functionsInModule[index]; if (typeof func === "undefined") { throw new _helperApiError.CompileError("unknown function (".concat(index, ")")); } id = t.numberLiteralFromRaw(index, String(index)); signature = func.signature; } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Table") { var table = state.tablesInModule[index]; if (typeof table === "undefined") { throw new _helperApiError.CompileError("unknown table ".concat(index)); } id = t.numberLiteralFromRaw(index, String(index)); signature = null; } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Mem") { var memNode = state.memoriesInModule[index]; if (typeof memNode === "undefined") { throw new _helperApiError.CompileError("unknown memory ".concat(index)); } id = t.numberLiteralFromRaw(index, String(index)); signature = null; } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Global") { var global = state.globalsInModule[index]; if (typeof global === "undefined") { throw new _helperApiError.CompileError("unknown global ".concat(index)); } id = t.numberLiteralFromRaw(index, String(index)); signature = null; } else { console.warn("Unsupported export type: " + toHex(typeIndex)); return; } var endLoc = getPosition(); state.elementsInExportSection.push({ name: name.value, type: _helperWasmBytecode.default.exportTypes[typeIndex], signature: signature, id: id, index: index, endLoc: endLoc, startLoc: _startLoc3 }); } } // Code section // https://webassembly.github.io/spec/binary/modules.html#code-section function parseCodeSection(numberOfFuncs) { dump([numberOfFuncs], "number functions"); // Parse vector of function for (var i = 0; i < numberOfFuncs; i++) { var _startLoc4 = getPosition(); dumpSep("function body " + i); // the u32 size of the function code in bytes // Ignore it for now var bodySizeU32 = readU32(); eatBytes(bodySizeU32.nextIndex); dump([bodySizeU32.value], "function body size"); var code = []; /** * Parse locals */ var funcLocalNumU32 = readU32(); var funcLocalNum = funcLocalNumU32.value; eatBytes(funcLocalNumU32.nextIndex); dump([funcLocalNum], "num locals"); var locals = []; for (var _i = 0; _i < funcLocalNum; _i++) { var _startLoc5 = getPosition(); var localCountU32 = readU32(); var localCount = localCountU32.value; eatBytes(localCountU32.nextIndex); dump([localCount], "num local"); var valtypeByte = readByte(); eatBytes(1); var type = _helperWasmBytecode.default.valtypes[valtypeByte]; var args = []; for (var _i2 = 0; _i2 < localCount; _i2++) { args.push(t.valtypeLiteral(type)); } var localNode = function () { var endLoc = getPosition(); return t.withLoc(t.instruction("local", args), endLoc, _startLoc5); }(); locals.push(localNode); dump([valtypeByte], type); if (typeof type === "undefined") { throw new _helperApiError.CompileError("Unexpected valtype: " + toHex(valtypeByte)); } } code.push.apply(code, locals); // Decode instructions until the end parseInstructionBlock(code); var endLoc = getPosition(); state.elementsInCodeSection.push({ code: code, locals: locals, endLoc: endLoc, startLoc: _startLoc4, bodySize: bodySizeU32.value }); } } function parseInstructionBlock(code) { while (true) { var _startLoc6 = getPosition(); var instructionAlreadyCreated = false; var instructionByte = readByte(); eatBytes(1); if (instructionByte === 0xfe) { instructionByte = 0xfe00 + readByte(); eatBytes(1); } var instruction = _helperWasmBytecode.default.symbolsByByte[instructionByte]; if (typeof instruction === "undefined") { throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte)); } if (typeof instruction.object === "string") { dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name)); } else { dump([instructionByte], instruction.name); } /** * End of the function */ if (instruction.name === "end") { var node = function () { var endLoc = getPosition(); return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6); }(); code.push(node); break; } var args = []; if (instruction.name === "loop") { var _startLoc7 = getPosition(); var blocktypeByte = readByte(); eatBytes(1); var blocktype = _helperWasmBytecode.default.blockTypes[blocktypeByte]; dump([blocktypeByte], "blocktype"); if (typeof blocktype === "undefined") { throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(blocktypeByte)); } var instr = []; parseInstructionBlock(instr); // preserve anonymous var label = t.withRaw(t.identifier(getUniqueName("loop")), ""); var loopNode = function () { var endLoc = getPosition(); return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7); }(); code.push(loopNode); instructionAlreadyCreated = true; } else if (instruction.name === "if") { var _startLoc8 = getPosition(); var _blocktypeByte = readByte(); eatBytes(1); var _blocktype = _helperWasmBytecode.default.blockTypes[_blocktypeByte]; dump([_blocktypeByte], "blocktype"); if (typeof _blocktype === "undefined") { throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte)); } var testIndex = t.withRaw(t.identifier(getUniqueName("if")), ""); var ifBody = []; parseInstructionBlock(ifBody); // Defaults to no alternate var elseIndex = 0; for (elseIndex = 0; elseIndex < ifBody.length; ++elseIndex) { var _instr = ifBody[elseIndex]; if (_instr.type === "Instr" && _instr.id === "else") { break; } } var consequentInstr = ifBody.slice(0, elseIndex); var alternate = ifBody.slice(elseIndex + 1); // wast sugar var testInstrs = []; var ifNode = function () { var endLoc = getPosition(); return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8); }(); code.push(ifNode); instructionAlreadyCreated = true; } else if (instruction.name === "block") { var _startLoc9 = getPosition(); var _blocktypeByte2 = readByte(); eatBytes(1); var _blocktype2 = _helperWasmBytecode.default.blockTypes[_blocktypeByte2]; dump([_blocktypeByte2], "blocktype"); if (typeof _blocktype2 === "undefined") { throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2)); } var _instr2 = []; parseInstructionBlock(_instr2); // preserve anonymous var _label = t.withRaw(t.identifier(getUniqueName("block")), ""); var blockNode = function () { var endLoc = getPosition(); return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9); }(); code.push(blockNode); instructionAlreadyCreated = true; } else if (instruction.name === "call") { var indexu32 = readU32(); var index = indexu32.value; eatBytes(indexu32.nextIndex); dump([index], "index"); var callNode = function () { var endLoc = getPosition(); return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6); }(); code.push(callNode); instructionAlreadyCreated = true; } else if (instruction.name === "call_indirect") { var _startLoc10 = getPosition(); var indexU32 = readU32(); var typeindex = indexU32.value; eatBytes(indexU32.nextIndex); dump([typeindex], "type index"); var signature = state.typesInModule[typeindex]; if (typeof signature === "undefined") { throw new _helperApiError.CompileError("call_indirect signature not found (".concat(typeindex, ")")); } var _callNode = t.callIndirectInstruction(t.signature(signature.params, signature.result), []); var flagU32 = readU32(); var flag = flagU32.value; // 0x00 - reserved byte eatBytes(flagU32.nextIndex); if (flag !== 0) { throw new _helperApiError.CompileError("zero flag expected"); } code.push(function () { var endLoc = getPosition(); return t.withLoc(_callNode, endLoc, _startLoc10); }()); instructionAlreadyCreated = true; } else if (instruction.name === "br_table") { var indicesu32 = readU32(); var indices = indicesu32.value; eatBytes(indicesu32.nextIndex); dump([indices], "num indices"); for (var i = 0; i <= indices; i++) { var _indexu = readU32(); var _index = _indexu.value; eatBytes(_indexu.nextIndex); dump([_index], "index"); args.push(t.numberLiteralFromRaw(_indexu.value.toString(), "u32")); } } else if (instructionByte >= 0x28 && instructionByte <= 0x40) { /** * Memory instructions */ if (instruction.name === "grow_memory" || instruction.name === "current_memory") { var _indexU = readU32(); var _index2 = _indexU.value; eatBytes(_indexU.nextIndex); if (_index2 !== 0) { throw new Error("zero flag expected"); } dump([_index2], "index"); } else { var aligun32 = readU32(); var align = aligun32.value; eatBytes(aligun32.nextIndex); dump([align], "align"); var offsetu32 = readU32(); var _offset2 = offsetu32.value; eatBytes(offsetu32.nextIndex); dump([_offset2], "offset"); } } else if (instructionByte >= 0x41 && instructionByte <= 0x44) { /** * Numeric instructions */ if (instruction.object === "i32") { var value32 = read32(); var value = value32.value; eatBytes(value32.nextIndex); dump([value], "i32 value"); args.push(t.numberLiteralFromRaw(value)); } if (instruction.object === "u32") { var valueu32 = readU32(); var _value = valueu32.value; eatBytes(valueu32.nextIndex); dump([_value], "u32 value"); args.push(t.numberLiteralFromRaw(_value)); } if (instruction.object === "i64") { var value64 = read64(); var _value2 = value64.value; eatBytes(value64.nextIndex); dump([Number(_value2.toString())], "i64 value"); var high = _value2.high, low = _value2.low; var _node = { type: "LongNumberLiteral", value: { high: high, low: low } }; args.push(_node); } if (instruction.object === "u64") { var valueu64 = readU64(); var _value3 = valueu64.value; eatBytes(valueu64.nextIndex); dump([Number(_value3.toString())], "u64 value"); var _high = _value3.high, _low = _value3.low; var _node2 = { type: "LongNumberLiteral", value: { high: _high, low: _low } }; args.push(_node2); } if (instruction.object === "f32") { var valuef32 = readF32(); var _value4 = valuef32.value; eatBytes(valuef32.nextIndex); dump([_value4], "f32 value"); args.push( // $FlowIgnore t.floatLiteral(_value4, valuef32.nan, valuef32.inf, String(_value4))); } if (instruction.object === "f64") { var valuef64 = readF64(); var _value5 = valuef64.value; eatBytes(valuef64.nextIndex); dump([_value5], "f64 value"); args.push( // $FlowIgnore t.floatLiteral(_value5, valuef64.nan, valuef64.inf, String(_value5))); } } else if (instructionByte >= 0xfe00 && instructionByte <= 0xfeff) { /** * Atomic memory instructions */ var align32 = readU32(); var _align = align32.value; eatBytes(align32.nextIndex); dump([_align], "align"); var _offsetu = readU32(); var _offset3 = _offsetu.value; eatBytes(_offsetu.nextIndex); dump([_offset3], "offset"); } else { for (var _i3 = 0; _i3 < instruction.numberOfArgs; _i3++) { var u32 = readU32(); eatBytes(u32.nextIndex); dump([u32.value], "argument " + _i3); args.push(t.numberLiteralFromRaw(u32.value)); } } if (instructionAlreadyCreated === false) { if (typeof instruction.object === "string") { var _node3 = function () { var endLoc = getPosition(); return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args), endLoc, _startLoc6); }(); code.push(_node3); } else { var _node4 = function () { var endLoc = getPosition(); return t.withLoc(t.instruction(instruction.name, args), endLoc, _startLoc6); }(); code.push(_node4); } } } } // https://webassembly.github.io/spec/core/binary/types.html#limits function parseLimits() { var limitType = readByte(); eatBytes(1); var shared = limitType === 0x03; dump([limitType], "limit type" + (shared ? " (shared)" : "")); var min, max; if (limitType === 0x01 || limitType === 0x03 // shared limits ) { var u32min = readU32(); min = parseInt(u32min.value); eatBytes(u32min.nextIndex); dump([min], "min"); var u32max = readU32(); max = parseInt(u32max.value); eatBytes(u32max.nextIndex); dump([max], "max"); } if (limitType === 0x00) { var _u32min = readU32(); min = parseInt(_u32min.value); eatBytes(_u32min.nextIndex); dump([min], "min"); } return t.limit(min, max, shared); } // https://webassembly.github.io/spec/core/binary/types.html#binary-tabletype function parseTableType(index) { var name = t.withRaw(t.identifier(getUniqueName("table")), String(index)); var elementTypeByte = readByte(); eatBytes(1); dump([elementTypeByte], "element type"); var elementType = _helperWasmBytecode.default.tableTypes[elementTypeByte]; if (typeof elementType === "undefined") { throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementType)); } var limits = parseLimits(); return t.table(elementType, limits, name); } // https://webassembly.github.io/spec/binary/types.html#global-types function parseGlobalType() { var valtypeByte = readByte(); eatBytes(1); var type = _helperWasmBytecode.default.valtypes[valtypeByte]; dump([valtypeByte], type); if (typeof type === "undefined") { throw new _helperApiError.CompileError("Unknown valtype: " + toHex(valtypeByte)); } var globalTypeByte = readByte(); eatBytes(1); var globalType = _helperWasmBytecode.default.globalTypes[globalTypeByte]; dump([globalTypeByte], "global type (".concat(globalType, ")")); if (typeof globalType === "undefined") { throw new _helperApiError.CompileError("Invalid mutability: " + toHex(globalTypeByte)); } return t.globalType(type, globalType); } // function parseNameModule() { // const lenu32 = readVaruint32(); // eatBytes(lenu32.nextIndex); // console.log("len", lenu32); // const strlen = lenu32.value; // dump([strlen], "string length"); // const bytes = readBytes(strlen); // eatBytes(strlen); // const value = utf8.decode(bytes); // return [t.moduleNameMetadata(value)]; // } // this section contains an array of function names and indices function parseNameSectionFunctions() { var functionNames = []; var numberOfFunctionsu32 = readU32(); var numbeOfFunctions = numberOfFunctionsu32.value; eatBytes(numberOfFunctionsu32.nextIndex); for (var i = 0; i < numbeOfFunctions; i++) { var indexu32 = readU32(); var index = indexu32.value; eatBytes(indexu32.nextIndex); var name = readUTF8String(); eatBytes(name.nextIndex); functionNames.push(t.functionNameMetadata(name.value, index)); } return functionNames; } function parseNameSectionLocals() { var localNames = []; var numbeOfFunctionsu32 = readU32(); var numbeOfFunctions = numbeOfFunctionsu32.value; eatBytes(numbeOfFunctionsu32.nextIndex); for (var i = 0; i < numbeOfFunctions; i++) { var functionIndexu32 = readU32(); var functionIndex = functionIndexu32.value; eatBytes(functionIndexu32.nextIndex); var numLocalsu32 = readU32(); var numLocals = numLocalsu32.value; eatBytes(numLocalsu32.nextIndex); for (var _i4 = 0; _i4 < numLocals; _i4++) { var localIndexu32 = readU32(); var localIndex = localIndexu32.value; eatBytes(localIndexu32.nextIndex); var name = readUTF8String(); eatBytes(name.nextIndex); localNames.push(t.localNameMetadata(name.value, localIndex, functionIndex)); } } return localNames; } // this is a custom section used for name resolution // https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section function parseNameSection(remainingBytes) { var nameMetadata = []; var initialOffset = offset; while (offset - initialOffset < remainingBytes) { // name_type var sectionTypeByte = readVaruint7(); eatBytes(sectionTypeByte.nextIndex); // name_payload_len var subSectionSizeInBytesu32 = readVaruint32(); eatBytes(subSectionSizeInBytesu32.nextIndex); switch (sectionTypeByte.value) { // case 0: { // TODO(sven): re-enable that // Current status: it seems that when we decode the module's name // no name_payload_len is used. // // See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section // // nameMetadata.push(...parseNameModule()); // break; // } case 1: { nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions())); break; } case 2: { nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionLocals())); break; } default: { // skip unknown subsection eatBytes(subSectionSizeInBytesu32.value); } } } return nameMetadata; } // this is a custom section used for information about the producers // https://github.com/WebAssembly/tool-conventions/blob/master/ProducersSection.md function parseProducersSection() { var metadata = t.producersSectionMetadata([]); // field_count var sectionTypeByte = readVaruint32(); eatBytes(sectionTypeByte.nextIndex); dump([sectionTypeByte.value], "num of producers"); var fields = { language: [], "processed-by": [], sdk: [] }; // fields for (var fieldI = 0; fieldI < sectionTypeByte.value; fieldI++) { // field_name var fieldName = readUTF8String(); eatBytes(fieldName.nextIndex); // field_value_count var valueCount = readVaruint32(); eatBytes(valueCount.nextIndex); // field_values for (var producerI = 0; producerI < valueCount.value; producerI++) { var producerName = readUTF8String(); eatBytes(producerName.nextIndex); var producerVersion = readUTF8String(); eatBytes(producerVersion.nextIndex); fields[fieldName.value].push(t.producerMetadataVersionedName(producerName.value, producerVersion.value)); } metadata.producers.push(fields[fieldName.value]); } return metadata; } function parseGlobalSection(numberOfGlobals) { var globals = []; dump([numberOfGlobals], "num globals"); for (var i = 0; i < numberOfGlobals; i++) { var _startLoc11 = getPosition(); var globalType = parseGlobalType(); /** * Global expressions */ var init = []; parseInstructionBlock(init); var node = function () { var endLoc = getPosition(); return t.withLoc(t.global(globalType, init), endLoc, _startLoc11); }(); globals.push(node); state.globalsInModule.push(node); } return globals; } function parseElemSection(numberOfElements) { var elems = []; dump([numberOfElements], "num elements"); for (var i = 0; i < numberOfElements; i++) { var _startLoc12 = getPosition(); var tableindexu32 = readU32(); var tableindex = tableindexu32.value; eatBytes(tableindexu32.nextIndex); dump([tableindex], "table index"); /** * Parse instructions */ var instr = []; parseInstructionBlock(instr); /** * Parse ( vector function index ) * */ var indicesu32 = readU32(); var indices = indicesu32.value; eatBytes(indicesu32.nextIndex); dump([indices], "num indices"); var indexValues = []; for (var _i5 = 0; _i5 < indices; _i5++) { var indexu32 = readU32(); var index = indexu32.value; eatBytes(indexu32.nextIndex); dump([index], "index"); indexValues.push(t.indexLiteral(index)); } var elemNode = function () { var endLoc = getPosition(); return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12); }(); elems.push(elemNode); } return elems; } // https://webassembly.github.io/spec/core/binary/types.html#memory-types function parseMemoryType(i) { var limits = parseLimits(); return t.memory(limits, t.indexLiteral(i)); } // https://webassembly.github.io/spec/binary/modules.html#table-section function parseTableSection(numberOfElements) { var tables = []; dump([numberOfElements], "num elements"); for (var i = 0; i < numberOfElements; i++) { var tablesNode = parseTableType(i); state.tablesInModule.push(tablesNode); tables.push(tablesNode); } return tables; } // https://webassembly.github.io/spec/binary/modules.html#memory-section function parseMemorySection(numberOfElements) { var memories = []; dump([numberOfElements], "num elements"); for (var i = 0; i < numberOfElements; i++) { var memoryNode = parseMemoryType(i); state.memoriesInModule.push(memoryNode); memories.push(memoryNode); } return memories; } // https://webassembly.github.io/spec/binary/modules.html#binary-startsec function parseStartSection() { var startLoc = getPosition(); var u32 = readU32(); var startFuncIndex = u32.value; eatBytes(u32.nextIndex); dump([startFuncIndex], "index"); return function () { var endLoc = getPosition(); return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc); }(); } // https://webassembly.github.io/spec/binary/modules.html#data-section function parseDataSection(numberOfElements) { var dataEntries = []; dump([numberOfElements], "num elements"); for (var i = 0; i < numberOfElements; i++) { var memoryIndexu32 = readU32(); var memoryIndex = memoryIndexu32.value; eatBytes(memoryIndexu32.nextIndex); dump([memoryIndex], "memory index"); var instrs = []; parseInstructionBlock(instrs); var hasExtraInstrs = instrs.filter(function (i) { return i.id !== "end"; }).length !== 1; if (hasExtraInstrs) { throw new _helperApiError.CompileError("data section offset must be a single instruction"); } var bytes = parseVec(function (b) { return b; }); dump([], "init"); dataEntries.push(t.data(t.memIndexLiteral(memoryIndex), instrs[0], t.byteArray(bytes))); } return dataEntries; } // https://webassembly.github.io/spec/binary/modules.html#binary-section function parseSection(sectionIndex) { var sectionId = readByte(); eatBytes(1); if (sectionId >= sectionIndex || sectionIndex === _helperWasmBytecode.default.sections.custom) { sectionIndex = sectionId + 1; } else { if (sectionId !== _helperWasmBytecode.default.sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); } var nextSectionIndex = sectionIndex; var startOffset = offset; var startLoc = getPosition(); var u32 = readU32(); var sectionSizeInBytes = u32.value; eatBytes(u32.nextIndex); var sectionSizeInBytesNode = function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc); }(); switch (sectionId) { case _helperWasmBytecode.default.sections.type: { dumpSep("section Type"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc13 = getPosition(); var _u = readU32(); var numberOfTypes = _u.value; eatBytes(_u.nextIndex); var _metadata = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13); }()); var _nodes = parseTypeSection(numberOfTypes); return { nodes: _nodes, metadata: _metadata, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.table: { dumpSep("section Table"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc14 = getPosition(); var _u2 = readU32(); var numberOfTable = _u2.value; eatBytes(_u2.nextIndex); dump([numberOfTable], "num tables"); var _metadata2 = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14); }()); var _nodes2 = parseTableSection(numberOfTable); return { nodes: _nodes2, metadata: _metadata2, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.import: { dumpSep("section Import"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc15 = getPosition(); var numberOfImportsu32 = readU32(); var numberOfImports = numberOfImportsu32.value; eatBytes(numberOfImportsu32.nextIndex); dump([numberOfImports], "number of imports"); var _metadata3 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15); }()); var _nodes3 = parseImportSection(numberOfImports); return { nodes: _nodes3, metadata: _metadata3, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.func: { dumpSep("section Function"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc16 = getPosition(); var numberOfFunctionsu32 = readU32(); var numberOfFunctions = numberOfFunctionsu32.value; eatBytes(numberOfFunctionsu32.nextIndex); var _metadata4 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16); }()); parseFuncSection(numberOfFunctions); var _nodes4 = []; return { nodes: _nodes4, metadata: _metadata4, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.export: { dumpSep("section Export"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc17 = getPosition(); var _u3 = readU32(); var numberOfExport = _u3.value; eatBytes(_u3.nextIndex); var _metadata5 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17); }()); parseExportSection(numberOfExport); var _nodes5 = []; return { nodes: _nodes5, metadata: _metadata5, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.code: { dumpSep("section Code"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc18 = getPosition(); var _u4 = readU32(); var numberOfFuncs = _u4.value; eatBytes(_u4.nextIndex); var _metadata6 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18); }()); if (opts.ignoreCodeSection === true) { var remainingBytes = sectionSizeInBytes - _u4.nextIndex; eatBytes(remainingBytes); // eat the entire section } else { parseCodeSection(numberOfFuncs); } var _nodes6 = []; return { nodes: _nodes6, metadata: _metadata6, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.start: { dumpSep("section Start"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _metadata7 = t.sectionMetadata("start", startOffset, sectionSizeInBytesNode); var _nodes7 = [parseStartSection()]; return { nodes: _nodes7, metadata: _metadata7, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.element: { dumpSep("section Element"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc19 = getPosition(); var numberOfElementsu32 = readU32(); var numberOfElements = numberOfElementsu32.value; eatBytes(numberOfElementsu32.nextIndex); var _metadata8 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19); }()); var _nodes8 = parseElemSection(numberOfElements); return { nodes: _nodes8, metadata: _metadata8, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.global: { dumpSep("section Global"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc20 = getPosition(); var numberOfGlobalsu32 = readU32(); var numberOfGlobals = numberOfGlobalsu32.value; eatBytes(numberOfGlobalsu32.nextIndex); var _metadata9 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20); }()); var _nodes9 = parseGlobalSection(numberOfGlobals); return { nodes: _nodes9, metadata: _metadata9, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.memory: { dumpSep("section Memory"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _startLoc21 = getPosition(); var _numberOfElementsu = readU32(); var _numberOfElements = _numberOfElementsu.value; eatBytes(_numberOfElementsu.nextIndex); var _metadata10 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21); }()); var _nodes10 = parseMemorySection(_numberOfElements); return { nodes: _nodes10, metadata: _metadata10, nextSectionIndex: nextSectionIndex }; } case _helperWasmBytecode.default.sections.data: { dumpSep("section Data"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _metadata11 = t.sectionMetadata("data", startOffset, sectionSizeInBytesNode); var _startLoc22 = getPosition(); var _numberOfElementsu2 = readU32(); var _numberOfElements2 = _numberOfElementsu2.value; eatBytes(_numberOfElementsu2.nextIndex); _metadata11.vectorOfSize = function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22); }(); if (opts.ignoreDataSection === true) { var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex; eatBytes(_remainingBytes); // eat the entire section dumpSep("ignore data (" + sectionSizeInBytes + " bytes)"); return { nodes: [], metadata: _metadata11, nextSectionIndex: nextSectionIndex }; } else { var _nodes11 = parseDataSection(_numberOfElements2); return { nodes: _nodes11, metadata: _metadata11, nextSectionIndex: nextSectionIndex }; } } case _helperWasmBytecode.default.sections.custom: { dumpSep("section Custom"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); var _metadata12 = [t.sectionMetadata("custom", startOffset, sectionSizeInBytesNode)]; var sectionName = readUTF8String(); eatBytes(sectionName.nextIndex); dump([], "section name (".concat(sectionName.value, ")")); var _remainingBytes2 = sectionSizeInBytes - sectionName.nextIndex; if (sectionName.value === "name") { var initialOffset = offset; try { _metadata12.push.apply(_metadata12, _toConsumableArray(parseNameSection(_remainingBytes2))); } catch (e) { console.warn("Failed to decode custom \"name\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); eatBytes(offset - (initialOffset + _remainingBytes2)); } } else if (sectionName.value === "producers") { var _initialOffset = offset; try { _metadata12.push(parseProducersSection()); } catch (e) { console.warn("Failed to decode custom \"producers\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); eatBytes(offset - (_initialOffset + _remainingBytes2)); } } else { // We don't parse the custom section eatBytes(_remainingBytes2); dumpSep("ignore custom " + JSON.stringify(sectionName.value) + " section (" + _remainingBytes2 + " bytes)"); } return { nodes: [], metadata: _metadata12, nextSectionIndex: nextSectionIndex }; } } throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); } parseModuleHeader(); parseVersion(); var moduleFields = []; var sectionIndex = 0; var moduleMetadata = { sections: [], functionNames: [], localNames: [], producers: [] }; /** * All the generate declaration are going to be stored in our state */ while (offset < buf.length) { var _parseSection = parseSection(sectionIndex), _nodes12 = _parseSection.nodes, _metadata13 = _parseSection.metadata, nextSectionIndex = _parseSection.nextSectionIndex; moduleFields.push.apply(moduleFields, _toConsumableArray(_nodes12)); var metadataArray = Array.isArray(_metadata13) ? _metadata13 : [_metadata13]; metadataArray.forEach(function (metadataItem) { if (metadataItem.type === "FunctionNameMetadata") { moduleMetadata.functionNames.push(metadataItem); } else if (metadataItem.type === "LocalNameMetadata") { moduleMetadata.localNames.push(metadataItem); } else if (metadataItem.type === "ProducersSectionMetadata") { moduleMetadata.producers.push(metadataItem); } else { moduleMetadata.sections.push(metadataItem); } }); // Ignore custom section if (nextSectionIndex) { sectionIndex = nextSectionIndex; } } /** * Transform the state into AST nodes */ var funcIndex = 0; state.functionsInModule.forEach(function (func) { var params = func.signature.params; var result = func.signature.result; var body = []; // External functions doesn't provide any code, can skip it here if (func.isExternal === true) { return; } var decodedElementInCodeSection = state.elementsInCodeSection[funcIndex]; if (opts.ignoreCodeSection === false) { if (typeof decodedElementInCodeSection === "undefined") { throw new _helperApiError.CompileError("func " + toHex(funcIndex) + " code not found"); } body = decodedElementInCodeSection.code; } funcIndex++; var funcNode = t.func(func.id, t.signature(params, result), body); if (func.isExternal === true) { funcNode.isExternal = func.isExternal; } // Add function position in the binary if possible if (opts.ignoreCodeSection === false) { var _startLoc23 = decodedElementInCodeSection.startLoc, endLoc = decodedElementInCodeSection.endLoc, bodySize = decodedElementInCodeSection.bodySize; funcNode = t.withLoc(funcNode, endLoc, _startLoc23); funcNode.metadata = { bodySize: bodySize }; } moduleFields.push(funcNode); }); state.elementsInExportSection.forEach(function (moduleExport) { /** * If the export has no id, we won't be able to call it from the outside * so we can omit it */ if (moduleExport.id != null) { moduleFields.push(t.withLoc(t.moduleExport(moduleExport.name, t.moduleExportDescr(moduleExport.type, moduleExport.id)), moduleExport.endLoc, moduleExport.startLoc)); } }); dumpSep("end of program"); var module = t.module(null, moduleFields, t.moduleMetadata(moduleMetadata.sections, moduleMetadata.functionNames, moduleMetadata.localNames, moduleMetadata.producers)); return t.program([module]); } /***/ }), /***/ 8062: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decode = decode; var decoder = _interopRequireWildcard(__webpack_require__(72856)); var t = _interopRequireWildcard(__webpack_require__(98688)); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } /** * TODO(sven): I added initial props, but we should rather fix * https://github.com/xtuc/webassemblyjs/issues/405 */ var defaultDecoderOpts = { dump: false, ignoreCodeSection: false, ignoreDataSection: false, ignoreCustomNameSection: false }; // traverses the AST, locating function name metadata, which is then // used to update index-based identifiers with function names function restoreFunctionNames(ast) { var functionNames = []; t.traverse(ast, { FunctionNameMetadata: function FunctionNameMetadata(_ref) { var node = _ref.node; functionNames.push({ name: node.value, index: node.index }); } }); if (functionNames.length === 0) { return; } t.traverse(ast, { Func: function (_Func) { function Func(_x) { return _Func.apply(this, arguments); } Func.toString = function () { return _Func.toString(); }; return Func; }(function (_ref2) { var node = _ref2.node; // $FlowIgnore var nodeName = node.name; var indexBasedFunctionName = nodeName.value; var index = Number(indexBasedFunctionName.replace("func_", "")); var functionName = functionNames.find(function (f) { return f.index === index; }); if (functionName) { var oldValue = nodeName.value; nodeName.value = functionName.name; nodeName.numeric = oldValue; // $FlowIgnore delete nodeName.raw; } }), // Also update the reference in the export ModuleExport: function (_ModuleExport) { function ModuleExport(_x2) { return _ModuleExport.apply(this, arguments); } ModuleExport.toString = function () { return _ModuleExport.toString(); }; return ModuleExport; }(function (_ref3) { var node = _ref3.node; if (node.descr.exportType === "Func") { // $FlowIgnore var nodeName = node.descr.id; var index = nodeName.value; var functionName = functionNames.find(function (f) { return f.index === index; }); if (functionName) { node.descr.id = t.identifier(functionName.name); } } }), ModuleImport: function (_ModuleImport) { function ModuleImport(_x3) { return _ModuleImport.apply(this, arguments); } ModuleImport.toString = function () { return _ModuleImport.toString(); }; return ModuleImport; }(function (_ref4) { var node = _ref4.node; if (node.descr.type === "FuncImportDescr") { // $FlowIgnore var indexBasedFunctionName = node.descr.id; var index = Number(indexBasedFunctionName.replace("func_", "")); var functionName = functionNames.find(function (f) { return f.index === index; }); if (functionName) { // $FlowIgnore node.descr.id = t.identifier(functionName.name); } } }), CallInstruction: function (_CallInstruction) { function CallInstruction(_x4) { return _CallInstruction.apply(this, arguments); } CallInstruction.toString = function () { return _CallInstruction.toString(); }; return CallInstruction; }(function (nodePath) { var node = nodePath.node; var index = node.index.value; var functionName = functionNames.find(function (f) { return f.index === index; }); if (functionName) { var oldValue = node.index; node.index = t.identifier(functionName.name); node.numeric = oldValue; // $FlowIgnore delete node.raw; } }) }); } function restoreLocalNames(ast) { var localNames = []; t.traverse(ast, { LocalNameMetadata: function LocalNameMetadata(_ref5) { var node = _ref5.node; localNames.push({ name: node.value, localIndex: node.localIndex, functionIndex: node.functionIndex }); } }); if (localNames.length === 0) { return; } t.traverse(ast, { Func: function (_Func2) { function Func(_x5) { return _Func2.apply(this, arguments); } Func.toString = function () { return _Func2.toString(); }; return Func; }(function (_ref6) { var node = _ref6.node; var signature = node.signature; if (signature.type !== "Signature") { return; } // $FlowIgnore var nodeName = node.name; var indexBasedFunctionName = nodeName.value; var functionIndex = Number(indexBasedFunctionName.replace("func_", "")); signature.params.forEach(function (param, paramIndex) { var paramName = localNames.find(function (f) { return f.localIndex === paramIndex && f.functionIndex === functionIndex; }); if (paramName && paramName.name !== "") { param.id = paramName.name; } }); }) }); } function restoreModuleName(ast) { t.traverse(ast, { ModuleNameMetadata: function (_ModuleNameMetadata) { function ModuleNameMetadata(_x6) { return _ModuleNameMetadata.apply(this, arguments); } ModuleNameMetadata.toString = function () { return _ModuleNameMetadata.toString(); }; return ModuleNameMetadata; }(function (moduleNameMetadataPath) { // update module t.traverse(ast, { Module: function (_Module) { function Module(_x7) { return _Module.apply(this, arguments); } Module.toString = function () { return _Module.toString(); }; return Module; }(function (_ref7) { var node = _ref7.node; var name = moduleNameMetadataPath.node.value; // compatiblity with wast-parser if (name === "") { name = null; } node.id = name; }) }); }) }); } function decode(buf, customOpts) { var opts = Object.assign({}, defaultDecoderOpts, customOpts); var ast = decoder.decode(buf, opts); if (opts.ignoreCustomNameSection === false) { restoreFunctionNames(ast); restoreLocalNames(ast); restoreModuleName(ast); } return ast; } /***/ }), /***/ 30848: /***/ (function(__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.read = read; exports.write = write; function read(buffer, offset, isLE, mLen, nBytes) { var e, m; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = -7; var i = isLE ? nBytes - 1 : 0; var d = isLE ? -1 : 1; var s = buffer[offset + i]; i += d; e = s & (1 << -nBits) - 1; s >>= -nBits; nBits += eLen; for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} m = e & (1 << -nBits) - 1; e >>= -nBits; nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : (s ? -1 : 1) * Infinity; } else { m = m + Math.pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); } function write(buffer, value, offset, isLE, mLen, nBytes) { var e, m, c; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; var i = isLE ? 0 : nBytes - 1; var d = isLE ? 1 : -1; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0; e = eMax; } else { e = Math.floor(Math.log(value) / Math.LN2); if (value * (c = Math.pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * Math.pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * Math.pow(2, mLen); e = e + eBias; } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128; } /***/ }), /***/ 77960: /***/ (function(module) { module.exports = Long; /** * wasm optimizations, to do native i64 multiplication and divide */ var wasm = null; try { wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 ])), {}).exports; } catch (e) { // no wasm support :( } /** * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. * See the from* functions below for more convenient ways of constructing Longs. * @exports Long * @class A Long class for representing a 64 bit two's-complement integer value. * @param {number} low The low (signed) 32 bits of the long * @param {number} high The high (signed) 32 bits of the long * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @constructor */ function Long(low, high, unsigned) { /** * The low 32 bits as a signed value. * @type {number} */ this.low = low | 0; /** * The high 32 bits as a signed value. * @type {number} */ this.high = high | 0; /** * Whether unsigned or not. * @type {boolean} */ this.unsigned = !!unsigned; } // The internal representation of a long is the two given signed, 32-bit values. // We use 32-bit pieces because these are the size of integers on which // Javascript performs bit-operations. For operations like addition and // multiplication, we split each number into 16 bit pieces, which can easily be // multiplied within Javascript's floating-point representation without overflow // or change in sign. // // In the algorithms below, we frequently reduce the negative case to the // positive case by negating the input(s) and then post-processing the result. // Note that we must ALWAYS check specially whether those values are MIN_VALUE // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as // a positive number, it overflows back into a negative). Not handling this // case would often result in infinite recursion. // // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* // methods on which they depend. /** * An indicator used to reliably determine if an object is a Long or not. * @type {boolean} * @const * @private */ Long.prototype.__isLong__; Object.defineProperty(Long.prototype, "__isLong__", { value: true }); /** * @function * @param {*} obj Object * @returns {boolean} * @inner */ function isLong(obj) { return (obj && obj["__isLong__"]) === true; } /** * Tests if the specified object is a Long. * @function * @param {*} obj Object * @returns {boolean} */ Long.isLong = isLong; /** * A cache of the Long representations of small integer values. * @type {!Object} * @inner */ var INT_CACHE = {}; /** * A cache of the Long representations of small unsigned integer values. * @type {!Object} * @inner */ var UINT_CACHE = {}; /** * @param {number} value * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromInt(value, unsigned) { var obj, cachedObj, cache; if (unsigned) { value >>>= 0; if (cache = (0 <= value && value < 256)) { cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); if (cache) UINT_CACHE[value] = obj; return obj; } else { value |= 0; if (cache = (-128 <= value && value < 128)) { cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, value < 0 ? -1 : 0, false); if (cache) INT_CACHE[value] = obj; return obj; } } /** * Returns a Long representing the given 32 bit integer value. * @function * @param {number} value The 32 bit integer in question * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromInt = fromInt; /** * @param {number} value * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromNumber(value, unsigned) { if (isNaN(value)) return unsigned ? UZERO : ZERO; if (unsigned) { if (value < 0) return UZERO; if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; } else { if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; } if (value < 0) return fromNumber(-value, unsigned).neg(); return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); } /** * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. * @function * @param {number} value The number in question * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromNumber = fromNumber; /** * @param {number} lowBits * @param {number} highBits * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromBits(lowBits, highBits, unsigned) { return new Long(lowBits, highBits, unsigned); } /** * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is * assumed to use 32 bits. * @function * @param {number} lowBits The low 32 bits * @param {number} highBits The high 32 bits * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} The corresponding Long value */ Long.fromBits = fromBits; /** * @function * @param {number} base * @param {number} exponent * @returns {number} * @inner */ var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) /** * @param {string} str * @param {(boolean|number)=} unsigned * @param {number=} radix * @returns {!Long} * @inner */ function fromString(str, unsigned, radix) { if (str.length === 0) throw Error('empty string'); if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return ZERO; if (typeof unsigned === 'number') { // For goog.math.long compatibility radix = unsigned, unsigned = false; } else { unsigned = !! unsigned; } radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError('radix'); var p; if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); else if (p === 0) { return fromString(str.substring(1), unsigned, radix).neg(); } // Do several (8) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. var radixToPower = fromNumber(pow_dbl(radix, 8)); var result = ZERO; for (var i = 0; i < str.length; i += 8) { var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = fromNumber(pow_dbl(radix, size)); result = result.mul(power).add(fromNumber(value)); } else { result = result.mul(radixToPower); result = result.add(fromNumber(value)); } } result.unsigned = unsigned; return result; } /** * Returns a Long representation of the given string, written using the specified radix. * @function * @param {string} str The textual representation of the Long * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 * @returns {!Long} The corresponding Long value */ Long.fromString = fromString; /** * @function * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val * @param {boolean=} unsigned * @returns {!Long} * @inner */ function fromValue(val, unsigned) { if (typeof val === 'number') return fromNumber(val, unsigned); if (typeof val === 'string') return fromString(val, unsigned); // Throws for non-objects, converts non-instanceof Long: return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); } /** * Converts the specified value to a Long using the appropriate from* function for its type. * @function * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {!Long} */ Long.fromValue = fromValue; // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be // no runtime penalty for these. /** * @type {number} * @const * @inner */ var TWO_PWR_16_DBL = 1 << 16; /** * @type {number} * @const * @inner */ var TWO_PWR_24_DBL = 1 << 24; /** * @type {number} * @const * @inner */ var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; /** * @type {number} * @const * @inner */ var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; /** * @type {number} * @const * @inner */ var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; /** * @type {!Long} * @const * @inner */ var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); /** * @type {!Long} * @inner */ var ZERO = fromInt(0); /** * Signed zero. * @type {!Long} */ Long.ZERO = ZERO; /** * @type {!Long} * @inner */ var UZERO = fromInt(0, true); /** * Unsigned zero. * @type {!Long} */ Long.UZERO = UZERO; /** * @type {!Long} * @inner */ var ONE = fromInt(1); /** * Signed one. * @type {!Long} */ Long.ONE = ONE; /** * @type {!Long} * @inner */ var UONE = fromInt(1, true); /** * Unsigned one. * @type {!Long} */ Long.UONE = UONE; /** * @type {!Long} * @inner */ var NEG_ONE = fromInt(-1); /** * Signed negative one. * @type {!Long} */ Long.NEG_ONE = NEG_ONE; /** * @type {!Long} * @inner */ var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); /** * Maximum signed value. * @type {!Long} */ Long.MAX_VALUE = MAX_VALUE; /** * @type {!Long} * @inner */ var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); /** * Maximum unsigned value. * @type {!Long} */ Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; /** * @type {!Long} * @inner */ var MIN_VALUE = fromBits(0, 0x80000000|0, false); /** * Minimum signed value. * @type {!Long} */ Long.MIN_VALUE = MIN_VALUE; /** * @alias Long.prototype * @inner */ var LongPrototype = Long.prototype; /** * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. * @this {!Long} * @returns {number} */ LongPrototype.toInt = function toInt() { return this.unsigned ? this.low >>> 0 : this.low; }; /** * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). * @this {!Long} * @returns {number} */ LongPrototype.toNumber = function toNumber() { if (this.unsigned) return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); return this.high * TWO_PWR_32_DBL + (this.low >>> 0); }; /** * Converts the Long to a string written in the specified radix. * @this {!Long} * @param {number=} radix Radix (2-36), defaults to 10 * @returns {string} * @override * @throws {RangeError} If `radix` is out of range */ LongPrototype.toString = function toString(radix) { radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError('radix'); if (this.isZero()) return '0'; if (this.isNegative()) { // Unsigned Longs are never negative if (this.eq(MIN_VALUE)) { // We need to change the Long value before it can be negated, so we remove // the bottom-most digit in this base and then recurse to do the rest. var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); return div.toString(radix) + rem1.toInt().toString(radix); } else return '-' + this.neg().toString(radix); } // Do several (6) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; var result = ''; while (true) { var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); rem = remDiv; if (rem.isZero()) return digits + result; else { while (digits.length < 6) digits = '0' + digits; result = '' + digits + result; } } }; /** * Gets the high 32 bits as a signed integer. * @this {!Long} * @returns {number} Signed high bits */ LongPrototype.getHighBits = function getHighBits() { return this.high; }; /** * Gets the high 32 bits as an unsigned integer. * @this {!Long} * @returns {number} Unsigned high bits */ LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { return this.high >>> 0; }; /** * Gets the low 32 bits as a signed integer. * @this {!Long} * @returns {number} Signed low bits */ LongPrototype.getLowBits = function getLowBits() { return this.low; }; /** * Gets the low 32 bits as an unsigned integer. * @this {!Long} * @returns {number} Unsigned low bits */ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { return this.low >>> 0; }; /** * Gets the number of bits needed to represent the absolute value of this Long. * @this {!Long} * @returns {number} */ LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) // Unsigned Longs are never negative return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); var val = this.high != 0 ? this.high : this.low; for (var bit = 31; bit > 0; bit--) if ((val & (1 << bit)) != 0) break; return this.high != 0 ? bit + 33 : bit + 1; }; /** * Tests if this Long's value equals zero. * @this {!Long} * @returns {boolean} */ LongPrototype.isZero = function isZero() { return this.high === 0 && this.low === 0; }; /** * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. * @returns {boolean} */ LongPrototype.eqz = LongPrototype.isZero; /** * Tests if this Long's value is negative. * @this {!Long} * @returns {boolean} */ LongPrototype.isNegative = function isNegative() { return !this.unsigned && this.high < 0; }; /** * Tests if this Long's value is positive. * @this {!Long} * @returns {boolean} */ LongPrototype.isPositive = function isPositive() { return this.unsigned || this.high >= 0; }; /** * Tests if this Long's value is odd. * @this {!Long} * @returns {boolean} */ LongPrototype.isOdd = function isOdd() { return (this.low & 1) === 1; }; /** * Tests if this Long's value is even. * @this {!Long} * @returns {boolean} */ LongPrototype.isEven = function isEven() { return (this.low & 1) === 0; }; /** * Tests if this Long's value equals the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.equals = function equals(other) { if (!isLong(other)) other = fromValue(other); if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) return false; return this.high === other.high && this.low === other.low; }; /** * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.eq = LongPrototype.equals; /** * Tests if this Long's value differs from the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.notEquals = function notEquals(other) { return !this.eq(/* validates */ other); }; /** * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.neq = LongPrototype.notEquals; /** * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.ne = LongPrototype.notEquals; /** * Tests if this Long's value is less than the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lessThan = function lessThan(other) { return this.comp(/* validates */ other) < 0; }; /** * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lt = LongPrototype.lessThan; /** * Tests if this Long's value is less than or equal the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { return this.comp(/* validates */ other) <= 0; }; /** * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.lte = LongPrototype.lessThanOrEqual; /** * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.le = LongPrototype.lessThanOrEqual; /** * Tests if this Long's value is greater than the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.greaterThan = function greaterThan(other) { return this.comp(/* validates */ other) > 0; }; /** * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.gt = LongPrototype.greaterThan; /** * Tests if this Long's value is greater than or equal the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { return this.comp(/* validates */ other) >= 0; }; /** * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.gte = LongPrototype.greaterThanOrEqual; /** * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. * @function * @param {!Long|number|string} other Other value * @returns {boolean} */ LongPrototype.ge = LongPrototype.greaterThanOrEqual; /** * Compares this Long's value with the specified's. * @this {!Long} * @param {!Long|number|string} other Other value * @returns {number} 0 if they are the same, 1 if the this is greater and -1 * if the given one is greater */ LongPrototype.compare = function compare(other) { if (!isLong(other)) other = fromValue(other); if (this.eq(other)) return 0; var thisNeg = this.isNegative(), otherNeg = other.isNegative(); if (thisNeg && !otherNeg) return -1; if (!thisNeg && otherNeg) return 1; // At this point the sign bits are the same if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; // Both are positive if at least one is unsigned return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; }; /** * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. * @function * @param {!Long|number|string} other Other value * @returns {number} 0 if they are the same, 1 if the this is greater and -1 * if the given one is greater */ LongPrototype.comp = LongPrototype.compare; /** * Negates this Long's value. * @this {!Long} * @returns {!Long} Negated Long */ LongPrototype.negate = function negate() { if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; return this.not().add(ONE); }; /** * Negates this Long's value. This is an alias of {@link Long#negate}. * @function * @returns {!Long} Negated Long */ LongPrototype.neg = LongPrototype.negate; /** * Returns the sum of this and the specified Long. * @this {!Long} * @param {!Long|number|string} addend Addend * @returns {!Long} Sum */ LongPrototype.add = function add(addend) { if (!isLong(addend)) addend = fromValue(addend); // Divide each number into 4 chunks of 16 bits, and then sum the chunks. var a48 = this.high >>> 16; var a32 = this.high & 0xFFFF; var a16 = this.low >>> 16; var a00 = this.low & 0xFFFF; var b48 = addend.high >>> 16; var b32 = addend.high & 0xFFFF; var b16 = addend.low >>> 16; var b00 = addend.low & 0xFFFF; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 + b00; c16 += c00 >>> 16; c00 &= 0xFFFF; c16 += a16 + b16; c32 += c16 >>> 16; c16 &= 0xFFFF; c32 += a32 + b32; c48 += c32 >>> 16; c32 &= 0xFFFF; c48 += a48 + b48; c48 &= 0xFFFF; return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); }; /** * Returns the difference of this and the specified Long. * @this {!Long} * @param {!Long|number|string} subtrahend Subtrahend * @returns {!Long} Difference */ LongPrototype.subtract = function subtract(subtrahend) { if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); return this.add(subtrahend.neg()); }; /** * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. * @function * @param {!Long|number|string} subtrahend Subtrahend * @returns {!Long} Difference */ LongPrototype.sub = LongPrototype.subtract; /** * Returns the product of this and the specified Long. * @this {!Long} * @param {!Long|number|string} multiplier Multiplier * @returns {!Long} Product */ LongPrototype.multiply = function multiply(multiplier) { if (this.isZero()) return ZERO; if (!isLong(multiplier)) multiplier = fromValue(multiplier); // use wasm support if present if (wasm) { var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); return fromBits(low, wasm["get_high"](), this.unsigned); } if (multiplier.isZero()) return ZERO; if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; if (this.isNegative()) { if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); else return this.neg().mul(multiplier).neg(); } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); // If both longs are small, use float multiplication if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. // We can skip products that would overflow. var a48 = this.high >>> 16; var a32 = this.high & 0xFFFF; var a16 = this.low >>> 16; var a00 = this.low & 0xFFFF; var b48 = multiplier.high >>> 16; var b32 = multiplier.high & 0xFFFF; var b16 = multiplier.low >>> 16; var b00 = multiplier.low & 0xFFFF; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 * b00; c16 += c00 >>> 16; c00 &= 0xFFFF; c16 += a16 * b00; c32 += c16 >>> 16; c16 &= 0xFFFF; c16 += a00 * b16; c32 += c16 >>> 16; c16 &= 0xFFFF; c32 += a32 * b00; c48 += c32 >>> 16; c32 &= 0xFFFF; c32 += a16 * b16; c48 += c32 >>> 16; c32 &= 0xFFFF; c32 += a00 * b32; c48 += c32 >>> 16; c32 &= 0xFFFF; c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; c48 &= 0xFFFF; return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); }; /** * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. * @function * @param {!Long|number|string} multiplier Multiplier * @returns {!Long} Product */ LongPrototype.mul = LongPrototype.multiply; /** * Returns this Long divided by the specified. The result is signed if this Long is signed or * unsigned if this Long is unsigned. * @this {!Long} * @param {!Long|number|string} divisor Divisor * @returns {!Long} Quotient */ LongPrototype.divide = function divide(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); if (divisor.isZero()) throw Error('division by zero'); // use wasm support if present if (wasm) { // guard against signed division overflow: the largest // negative number / -1 would be 1 larger than the largest // positive number, due to two's complement. if (!this.unsigned && this.high === -0x80000000 && divisor.low === -1 && divisor.high === -1) { // be consistent with non-wasm code path return this; } var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( this.low, this.high, divisor.low, divisor.high ); return fromBits(low, wasm["get_high"](), this.unsigned); } if (this.isZero()) return this.unsigned ? UZERO : ZERO; var approx, rem, res; if (!this.unsigned) { // This section is only relevant for signed longs and is derived from the // closure library as a whole. if (this.eq(MIN_VALUE)) { if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE else if (divisor.eq(MIN_VALUE)) return ONE; else { // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. var halfThis = this.shr(1); approx = halfThis.div(divisor).shl(1); if (approx.eq(ZERO)) { return divisor.isNegative() ? ONE : NEG_ONE; } else { rem = this.sub(divisor.mul(approx)); res = approx.add(rem.div(divisor)); return res; } } } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; if (this.isNegative()) { if (divisor.isNegative()) return this.neg().div(divisor.neg()); return this.neg().div(divisor).neg(); } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); res = ZERO; } else { // The algorithm below has not been made for unsigned longs. It's therefore // required to take special care of the MSB prior to running it. if (!divisor.unsigned) divisor = divisor.toUnsigned(); if (divisor.gt(this)) return UZERO; if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true return UONE; res = UZERO; } // Repeat the following until the remainder is less than other: find a // floating-point that approximates remainder / other *from below*, add this // into the result, and subtract it from the remainder. It is critical that // the approximate value is less than or equal to the real value so that the // remainder never becomes negative. rem = this; while (rem.gte(divisor)) { // Approximate the result of division. This may be a little greater or // smaller than the actual value. approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); // We will tweak the approximate result by changing it in the 48-th digit or // the smallest non-fractional digit, whichever is larger. var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), // Decrease the approximation until it is smaller than the remainder. Note // that if it is too large, the product overflows and is negative. approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); while (approxRem.isNegative() || approxRem.gt(rem)) { approx -= delta; approxRes = fromNumber(approx, this.unsigned); approxRem = approxRes.mul(divisor); } // We know the answer can't be zero... and actually, zero would cause // infinite recursion since we would make no progress. if (approxRes.isZero()) approxRes = ONE; res = res.add(approxRes); rem = rem.sub(approxRem); } return res; }; /** * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Quotient */ LongPrototype.div = LongPrototype.divide; /** * Returns this Long modulo the specified. * @this {!Long} * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.modulo = function modulo(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); // use wasm support if present if (wasm) { var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( this.low, this.high, divisor.low, divisor.high ); return fromBits(low, wasm["get_high"](), this.unsigned); } return this.sub(this.div(divisor).mul(divisor)); }; /** * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.mod = LongPrototype.modulo; /** * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. * @function * @param {!Long|number|string} divisor Divisor * @returns {!Long} Remainder */ LongPrototype.rem = LongPrototype.modulo; /** * Returns the bitwise NOT of this Long. * @this {!Long} * @returns {!Long} */ LongPrototype.not = function not() { return fromBits(~this.low, ~this.high, this.unsigned); }; /** * Returns the bitwise AND of this Long and the specified. * @this {!Long} * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.and = function and(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low & other.low, this.high & other.high, this.unsigned); }; /** * Returns the bitwise OR of this Long and the specified. * @this {!Long} * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.or = function or(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low | other.low, this.high | other.high, this.unsigned); }; /** * Returns the bitwise XOR of this Long and the given one. * @this {!Long} * @param {!Long|number|string} other Other Long * @returns {!Long} */ LongPrototype.xor = function xor(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); }; /** * Returns this Long with bits shifted to the left by the given amount. * @this {!Long} * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftLeft = function shiftLeft(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); else return fromBits(0, this.low << (numBits - 32), this.unsigned); }; /** * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shl = LongPrototype.shiftLeft; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. * @this {!Long} * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftRight = function shiftRight(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); else return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); }; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shr = LongPrototype.shiftRight; /** * Returns this Long with bits logically shifted to the right by the given amount. * @this {!Long} * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned); if (numBits === 32) return fromBits(this.high, 0, this.unsigned); return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); }; /** * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shru = LongPrototype.shiftRightUnsigned; /** * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Shifted Long */ LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; /** * Returns this Long with bits rotated to the left by the given amount. * @this {!Long} * @param {number|!Long} numBits Number of bits * @returns {!Long} Rotated Long */ LongPrototype.rotateLeft = function rotateLeft(numBits) { var b; if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); if (numBits < 32) { b = (32 - numBits); return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned); } numBits -= 32; b = (32 - numBits); return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned); } /** * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Rotated Long */ LongPrototype.rotl = LongPrototype.rotateLeft; /** * Returns this Long with bits rotated to the right by the given amount. * @this {!Long} * @param {number|!Long} numBits Number of bits * @returns {!Long} Rotated Long */ LongPrototype.rotateRight = function rotateRight(numBits) { var b; if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); if (numBits < 32) { b = (32 - numBits); return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned); } numBits -= 32; b = (32 - numBits); return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned); } /** * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. * @function * @param {number|!Long} numBits Number of bits * @returns {!Long} Rotated Long */ LongPrototype.rotr = LongPrototype.rotateRight; /** * Converts this Long to signed. * @this {!Long} * @returns {!Long} Signed long */ LongPrototype.toSigned = function toSigned() { if (!this.unsigned) return this; return fromBits(this.low, this.high, false); }; /** * Converts this Long to unsigned. * @this {!Long} * @returns {!Long} Unsigned long */ LongPrototype.toUnsigned = function toUnsigned() { if (this.unsigned) return this; return fromBits(this.low, this.high, true); }; /** * Converts this Long to its byte representation. * @param {boolean=} le Whether little or big endian, defaults to big endian * @this {!Long} * @returns {!Array.} Byte representation */ LongPrototype.toBytes = function toBytes(le) { return le ? this.toBytesLE() : this.toBytesBE(); }; /** * Converts this Long to its little endian byte representation. * @this {!Long} * @returns {!Array.} Little endian byte representation */ LongPrototype.toBytesLE = function toBytesLE() { var hi = this.high, lo = this.low; return [ lo & 0xff, lo >>> 8 & 0xff, lo >>> 16 & 0xff, lo >>> 24 , hi & 0xff, hi >>> 8 & 0xff, hi >>> 16 & 0xff, hi >>> 24 ]; }; /** * Converts this Long to its big endian byte representation. * @this {!Long} * @returns {!Array.} Big endian byte representation */ LongPrototype.toBytesBE = function toBytesBE() { var hi = this.high, lo = this.low; return [ hi >>> 24 , hi >>> 16 & 0xff, hi >>> 8 & 0xff, hi & 0xff, lo >>> 24 , lo >>> 16 & 0xff, lo >>> 8 & 0xff, lo & 0xff ]; }; /** * Creates a Long from its byte representation. * @param {!Array.} bytes Byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @param {boolean=} le Whether little or big endian, defaults to big endian * @returns {Long} The corresponding Long value */ Long.fromBytes = function fromBytes(bytes, unsigned, le) { return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); }; /** * Creates a Long from its little endian byte representation. * @param {!Array.} bytes Little endian byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {Long} The corresponding Long value */ Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { return new Long( bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned ); }; /** * Creates a Long from its big endian byte representation. * @param {!Array.} bytes Big endian byte representation * @param {boolean=} unsigned Whether unsigned or not, defaults to signed * @returns {Long} The corresponding Long value */ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { return new Long( bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned ); }; /***/ }), /***/ 10666: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.importAssertions = importAssertions; var _acorn = _interopRequireWildcard(__webpack_require__(29089)); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const leftCurlyBrace = "{".charCodeAt(0); const space = " ".charCodeAt(0); const keyword = "assert"; const FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; function importAssertions(Parser) { // Use supplied version acorn version if present, to avoid // reference mismatches due to different acorn versions. This // allows this plugin to be used with Rollup which supplies // its own internal version of acorn and thereby sidesteps // the package manager. const acorn = Parser.acorn || _acorn; const { tokTypes: tt, TokenType } = acorn; return class extends Parser { constructor(...args) { super(...args); this.assertToken = new TokenType(keyword); } _codeAt(i) { return this.input.charCodeAt(i); } _eat(t) { if (this.type !== t) { this.unexpected(); } this.next(); } readToken(code) { let i = 0; for (; i < keyword.length; i++) { if (this._codeAt(this.pos + i) !== keyword.charCodeAt(i)) { return super.readToken(code); } } // ensure that the keyword is at the correct location // ie `assert{...` or `assert {...` for (;; i++) { if (this._codeAt(this.pos + i) === leftCurlyBrace) { // Found '{' break; } else if (this._codeAt(this.pos + i) === space) { // white space is allowed between `assert` and `{`, so continue. continue; } else { return super.readToken(code); } } // If we're inside a dynamic import expression we'll parse // the `assert` keyword as a standard object property name // ie `import(""./foo.json", { assert: { type: "json" } })` if (this.type.label === "{") { return super.readToken(code); } this.pos += keyword.length; return this.finishToken(this.assertToken); } parseDynamicImport(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); if (this.eat(tt.comma)) { const obj = this.parseObj(false); node.arguments = [obj]; } this._eat(tt.parenR); return this.finishNode(node, "ImportExpression"); } // ported from acorn/src/statement.js pp.parseExport parseExport(node, exports) { this.next(); // export * from '...' if (this.eat(tt.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { node.exported = this.parseIdent(true); this.checkExport(exports, node.exported.name, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); if (this.type !== tt.string) { this.unexpected(); } node.source = this.parseExprAtom(); if (this.type === this.assertToken) { this.next(); const assertions = this.parseImportAssertions(); if (assertions) { node.assertions = assertions; } } this.semicolon(); return this.finishNode(node, "ExportAllDeclaration"); } if (this.eat(tt._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; if (this.type === tt._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === tt._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { node.declaration = this.parseMaybeAssign(); this.semicolon(); } return this.finishNode(node, "ExportDefaultDeclaration"); } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { node.declaration = this.parseStatement(null); if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { if (this.type !== tt.string) { this.unexpected(); } node.source = this.parseExprAtom(); if (this.type === this.assertToken) { this.next(); const assertions = this.parseImportAssertions(); if (assertions) { node.assertions = assertions; } } } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { // check for keywords used as local names var spec = list[i]; this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); } node.source = null; } this.semicolon(); } return this.finishNode(node, "ExportNamedDeclaration"); } parseImport(node) { this.next(); // import '...' if (this.type === tt.string) { node.specifiers = []; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); } if (this.type === this.assertToken) { this.next(); const assertions = this.parseImportAssertions(); if (assertions) { node.assertions = assertions; } } this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportAssertions() { this._eat(tt.braceL); const attrs = this.parseAssertEntries(); this._eat(tt.braceR); return attrs; } parseAssertEntries() { const attrs = []; const attrNames = new Set(); do { if (this.type === tt.braceR) { break; } const node = this.startNode(); // parse AssertionKey : IdentifierName, StringLiteral let assertionKeyNode; if (this.type === tt.string) { assertionKeyNode = this.parseLiteral(this.value); } else { assertionKeyNode = this.parseIdent(true); } this.next(); node.key = assertionKeyNode; // for now we are only allowing `type` as the only allowed module attribute if (node.key.name !== "type") { this.raise(this.pos, "The only accepted import assertion is `type`"); } // check if we already have an entry for an attribute // if a duplicate entry is found, throw an error // for now this logic will come into play only when someone declares `type` twice if (attrNames.has(node.key.name)) { this.raise(this.pos, "Duplicated key in assertions"); } attrNames.add(node.key.name); if (this.type !== tt.string) { this.raise(this.pos, "Only string is supported as an assertion value"); } node.value = this.parseLiteral(this.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(tt.comma)); return attrs; } }; } /***/ }), /***/ 29089: /***/ (function(__unused_webpack_module, exports) { (function (global, factory) { true ? factory(exports) : 0; }(this, (function (exports) { 'use strict'; // Reserved word lists for various dialects of the language var reservedWords = { 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", 5: "class enum extends super const export import", 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" }; // And the keywords var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; var keywords = { 5: ecma5AndLessKeywords, "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" }; var keywordRelationalOperator = /^in(stanceof)?$/; // ## Character categories // Big ugly regular expressions that match characters in the // whitespace, identifier, and identifier-start categories. These // are only applied when a character is found to actually have a // code point above 128. // Generated by `bin/generate-identifier-regex.js`. var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the // >0xffff code points that are a valid part of identifiers. The // offset starts at 0x10000, and each pair of numbers represents an // offset to the next range, and then a size of the range. They were // generated by bin/generate-identifier-regex.js // eslint-disable-next-line comma-spacing var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; // eslint-disable-next-line comma-spacing var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. function isInAstralSet(code, set) { var pos = 0x10000; for (var i = 0; i < set.length; i += 2) { pos += set[i]; if (pos > code) { return false } pos += set[i + 1]; if (pos >= code) { return true } } } // Test whether a given character code starts an identifier. function isIdentifierStart(code, astral) { if (code < 65) { return code === 36 } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) } // Test whether a given character is part of an identifier. function isIdentifierChar(code, astral) { if (code < 48) { return code === 36 } if (code < 58) { return true } if (code < 65) { return false } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) } // ## Token types // The assignment of fine-grained, information-carrying type objects // allows the tokenizer to store the information it has about a // token in a way that is very cheap for the parser to look up. // All token type variables start with an underscore, to make them // easy to recognize. // The `beforeExpr` property is used to disambiguate between regular // expressions and divisions. It is set on all token types that can // be followed by an expression (thus, a slash after them would be a // regular expression). // // The `startsExpr` property is used to check if the token ends a // `yield` expression. It is set on all token types that either can // directly start an expression (like a quotation mark) or can // continue an expression (like the body of a string). // // `isLoop` marks a keyword as starting a loop, which is important // to know when parsing a label, in order to allow or disallow // continue jumps to that label. var TokenType = function TokenType(label, conf) { if ( conf === void 0 ) conf = {}; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop || null; this.updateContext = null; }; function binop(name, prec) { return new TokenType(name, {beforeExpr: true, binop: prec}) } var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; // Map keyword names to token types. var keywords$1 = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; return keywords$1[name] = new TokenType(name, options) } var types = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), name: new TokenType("name", startsExpr), privateId: new TokenType("privateId", startsExpr), eof: new TokenType("eof"), // Punctuation token types. bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), bracketR: new TokenType("]"), braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), braceR: new TokenType("}"), parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), parenR: new TokenType(")"), comma: new TokenType(",", beforeExpr), semi: new TokenType(";", beforeExpr), colon: new TokenType(":", beforeExpr), dot: new TokenType("."), question: new TokenType("?", beforeExpr), questionDot: new TokenType("?."), arrow: new TokenType("=>", beforeExpr), template: new TokenType("template"), invalidTemplate: new TokenType("invalidTemplate"), ellipsis: new TokenType("...", beforeExpr), backQuote: new TokenType("`", startsExpr), dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), // Operators. These carry several kinds of properties to help the // parser use them properly (the presence of these properties is // what categorizes them as operators). // // `binop`, when present, specifies that this operator is a binary // operator, and will refer to its precedence. // // `prefix` and `postfix` mark the operator as a prefix or postfix // unary operator. // // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as // binary operators with a very low precedence, that should result // in AssignmentExpression nodes. eq: new TokenType("=", {beforeExpr: true, isAssign: true}), assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("/<=/>=", 7), bitShift: binop("<>/>>>", 8), plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new TokenType("**", {beforeExpr: true}), coalesce: binop("??", 1), // Keyword token types. _break: kw("break"), _case: kw("case", beforeExpr), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", beforeExpr), _do: kw("do", {isLoop: true, beforeExpr: true}), _else: kw("else", beforeExpr), _finally: kw("finally"), _for: kw("for", {isLoop: true}), _function: kw("function", startsExpr), _if: kw("if"), _return: kw("return", beforeExpr), _switch: kw("switch"), _throw: kw("throw", beforeExpr), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", {isLoop: true}), _with: kw("with"), _new: kw("new", {beforeExpr: true, startsExpr: true}), _this: kw("this", startsExpr), _super: kw("super", startsExpr), _class: kw("class", startsExpr), _extends: kw("extends", beforeExpr), _export: kw("export"), _import: kw("import", startsExpr), _null: kw("null", startsExpr), _true: kw("true", startsExpr), _false: kw("false", startsExpr), _in: kw("in", {beforeExpr: true, binop: 7}), _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) }; // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 } var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; var ref = Object.prototype; var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; // Checks if an object has a property. function has(obj, propName) { return hasOwnProperty.call(obj, propName) } var isArray = Array.isArray || (function (obj) { return ( toString.call(obj) === "[object Array]" ); }); function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. var Position = function Position(line, col) { this.line = line; this.column = col; }; Position.prototype.offset = function offset (n) { return new Position(this.line, this.column + n) }; var SourceLocation = function SourceLocation(p, start, end) { this.start = start; this.end = end; if (p.sourceFile !== null) { this.source = p.sourceFile; } }; // The `getLineInfo` function is mostly useful when the // `locations` option is off (for performance reasons) and you // want to find the line/column position for a given character // offset. `input` should be the code string that the offset refers // into. function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { lineBreakG.lastIndex = cur; var match = lineBreakG.exec(input); if (match && match.index < offset) { ++line; cur = match.index + match[0].length; } else { return new Position(line, offset - cur) } } } // A second argument must be given to configure the parser process. // These options are recognized (only `ecmaVersion` is required): var defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 // (2019), 11 (2020), 12 (2021), 13 (2022), or `"latest"` (the // latest version the library supports). This influences support // for strict mode, the set of reserved words, and support for // new syntax features. ecmaVersion: null, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. sourceType: "script", // `onInsertedSemicolon` can be a callback that will be called // when a semicolon is automatically inserted. It will be passed // the position of the comma as an offset, and if `locations` is // enabled, it is given the location as a `{line, column}` object // as second argument. onInsertedSemicolon: null, // `onTrailingComma` is similar to `onInsertedSemicolon`, but for // trailing commas. onTrailingComma: null, // By default, reserved words are only enforced if ecmaVersion >= 5. // Set `allowReserved` to a boolean value to explicitly turn this on // an off. When this option has the value "never", reserved words // and keywords can also not be used as property names. allowReserved: null, // When enabled, a return at the top level is not considered an // error. allowReturnOutsideFunction: false, // When enabled, import/export statements are not constrained to // appearing at the top of the program, and an import.meta expression // in a script isn't considered an error. allowImportExportEverywhere: false, // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. allowAwaitOutsideFunction: null, // When enabled, super identifiers are not constrained to // appearing in methods and do not raise an error when they appear elsewhere. allowSuperOutsideMethod: null, // When enabled, hashbang directive in the beginning of file // is allowed and treated as a line comment. allowHashBang: false, // When `locations` is on, `loc` properties holding objects with // `start` and `end` properties in `{line, column}` form (with // line being 1-based and column 0-based) will be attached to the // nodes. locations: false, // A function can be passed as `onToken` option, which will // cause Acorn to call that function with object in the same // format as tokens returned from `tokenizer().getToken()`. Note // that you are not allowed to call the parser from the // callback—that will corrupt its internal state. onToken: null, // A function can be passed as `onComment` option, which will // cause Acorn to call that function with `(block, text, start, // end)` parameters whenever a comment is skipped. `block` is a // boolean indicating whether this is a block (`/* */`) comment, // `text` is the content of the comment, and `start` and `end` are // character offsets that denote the start and end of the comment. // When the `locations` option is on, two more parameters are // passed, the full `{line, column}` locations of the start and // end of the comments. Note that you are not allowed to call the // parser from the callback—that will corrupt its internal state. onComment: null, // Nodes have their start and end characters offsets recorded in // `start` and `end` properties (directly on the node, rather than // the `loc` object, which holds line/column data. To also add a // [semi-standardized][range] `range` property holding a `[start, // end]` array with the same numbers, set the `ranges` option to // `true`. // // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 ranges: false, // It is possible to parse multiple files into a single AST by // passing the tree produced by parsing the first file as // `program` option in subsequent parses. This will add the // toplevel forms of the parsed file to the `Program` (top) node // of an existing parse tree. program: null, // When `locations` is on, you can pass this to record the source // file in every node's `loc` object. sourceFile: null, // This value, if given, is stored in every node, whether // `locations` is on or off. directSourceFile: null, // When enabled, parenthesized expressions are represented by // (non-standard) ParenthesizedExpression nodes preserveParens: false }; // Interpret and default an options object var warnedAboutEcmaVersion = false; function getOptions(opts) { var options = {}; for (var opt in defaultOptions) { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion === "latest") { options.ecmaVersion = 1e8; } else if (options.ecmaVersion == null) { if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { warnedAboutEcmaVersion = true; console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); } options.ecmaVersion = 11; } else if (options.ecmaVersion >= 2015) { options.ecmaVersion -= 2009; } if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } if (isArray(options.onToken)) { var tokens = options.onToken; options.onToken = function (token) { return tokens.push(token); }; } if (isArray(options.onComment)) { options.onComment = pushComment(options, options.onComment); } return options } function pushComment(options, array) { return function(block, text, start, end, startLoc, endLoc) { var comment = { type: block ? "Block" : "Line", value: text, start: start, end: end }; if (options.locations) { comment.loc = new SourceLocation(this, startLoc, endLoc); } if (options.ranges) { comment.range = [start, end]; } array.push(comment); } } // Each scope gets a bitset that may contain these flags var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; function functionFlags(async, generator) { return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) } // Used in checkLVal* and declareName to determine the type of a binding var BIND_NONE = 0, // Not a binding BIND_VAR = 1, // Var-style binding BIND_LEXICAL = 2, // Let- or const-style binding BIND_FUNCTION = 3, // Function declaration BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding BIND_OUTSIDE = 5; // Special case for function names as bound inside the function var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; if (options.sourceType === "module") { reserved += " await"; } } this.reservedWords = wordsRegexp(reserved); var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; this.reservedWordsStrict = wordsRegexp(reservedStrict); this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); this.input = String(input); // Used to signal to callers of `readWord1` whether the word // contained any escape sequences. This is needed because words with // escape sequences must not be interpreted as keywords. this.containsEsc = false; // Set up token state // The current position of the tokenizer in the input. if (startPos) { this.pos = startPos; this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; } else { this.pos = this.lineStart = 0; this.curLine = 1; } // Properties of the current token: // Its type this.type = types.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset this.start = this.end = this.pos; // And, if locations are used, the {line, column} object // corresponding to those offsets this.startLoc = this.endLoc = this.curPosition(); // Position information for the previous token this.lastTokEndLoc = this.lastTokStartLoc = null; this.lastTokStart = this.lastTokEnd = this.pos; // The context stack is used to superficially track syntactic // context to predict whether a regular expression is allowed in a // given position. this.context = this.initialContext(); this.exprAllowed = true; // Figure out if it's a module code. this.inModule = options.sourceType === "module"; this.strict = this.inModule || this.strictDirective(this.pos); // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; this.potentialArrowInForAwait = false; // Positions to delayed-check that yield/await does not exist in default parameters. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; // Labels in scope. this.labels = []; // Thus-far undefined exports. this.undefinedExports = Object.create(null); // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { this.skipLineComment(2); } // Scope tracking for duplicate variable names (see scope.js) this.scopeStack = []; this.enterScope(SCOPE_TOP); // For RegExp validation this.regexpState = null; // The stack of private names. // Each element has two properties: 'declared' and 'used'. // When it exited from the outermost class definition, all used private names must be declared. this.privateNameStack = []; }; var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; Parser.prototype.parse = function parse () { var node = this.options.program || this.startNode(); this.nextToken(); return this.parseTopLevel(node) }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; prototypeAccessors.canAwait.get = function () { for (var i = this.scopeStack.length - 1; i >= 0; i--) { var scope = this.scopeStack[i]; if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false } if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 } } return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction }; prototypeAccessors.allowSuper.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod }; prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; prototypeAccessors.allowNewDotTarget.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit }; prototypeAccessors.inClassStaticBlock.get = function () { return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 }; Parser.extend = function extend () { var plugins = [], len = arguments.length; while ( len-- ) plugins[ len ] = arguments[ len ]; var cls = this; for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } return cls }; Parser.parse = function parse (input, options) { return new this(options, input).parse() }; Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { var parser = new this(options, input, pos); parser.nextToken(); return parser.parseExpression() }; Parser.tokenizer = function tokenizer (input, options) { return new this(options, input) }; Object.defineProperties( Parser.prototype, prototypeAccessors ); var pp = Parser.prototype; // ## Parser utilities var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; pp.strictDirective = function(start) { for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this.input)[0].length; var match = literal.exec(this.input.slice(start)); if (!match) { return false } if ((match[1] || match[2]) === "use strict") { skipWhiteSpace.lastIndex = start + match[0].length; var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; var next = this.input.charAt(end); return next === ";" || next === "}" || (lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) } start += match[0].length; // Skip semicolon, if any. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this.input)[0].length; if (this.input[start] === ";") { start++; } } }; // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. pp.eat = function(type) { if (this.type === type) { this.next(); return true } else { return false } }; // Tests whether parsed token is a contextual keyword. pp.isContextual = function(name) { return this.type === types.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. pp.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true }; // Asserts that following token is given contextual keyword. pp.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. pp.canInsertSemicolon = function() { return this.type === types.eof || this.type === types.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; pp.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } return true } }; // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. pp.semicolon = function() { if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } }; pp.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } if (!notNext) { this.next(); } return true } }; // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. pp.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. pp.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; function DestructuringErrors() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; } pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } }; pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } if (shorthandAssign >= 0) { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } if (doubleProto >= 0) { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; pp.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; pp.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; var pp$1 = Parser.prototype; // ### Statement parsing // Parse a program. Initializes the parser, reads any number of // statements, and wraps them in a Program node. Optionally takes a // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. pp$1.parseTopLevel = function(node) { var exports = Object.create(null); if (!node.body) { node.body = []; } while (this.type !== types.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } if (this.inModule) { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) { var name = list[i]; this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); } } this.adaptDirectivePrologue(node.body); this.next(); node.sourceType = this.options.sourceType; return this.finishNode(node, "Program") }; var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; pp$1.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); // For ambiguous cases, determine if a LexicalDeclaration (or only a // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral if (context) { return false } if (nextCh === 123) { return true } // '{' if (isIdentifierStart(nextCh, true)) { var pos = next + 1; while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } var ident = this.input.slice(next, pos); if (!keywordRelationalOperator.test(ident)) { return true } } return false }; // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. pp$1.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, after; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) }; // Parse a single statement. // // If expecting a statement and finding a slash operator, parse a // regular expression literal. This is to handle cases like // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. pp$1.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { starttype = types._var; kind = "let"; } // Most types of statements are recognized by the keyword they // start with. Many are trivial to parse, some require a bit of // complexity. switch (starttype) { case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) case types._debugger: return this.parseDebuggerStatement(node) case types._do: return this.parseDoStatement(node) case types._for: return this.parseForStatement(node) case types._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) case types._class: if (context) { this.unexpected(); } return this.parseClass(node, true) case types._if: return this.parseIfStatement(node) case types._return: return this.parseReturnStatement(node) case types._switch: return this.parseSwitchStatement(node) case types._throw: return this.parseThrowStatement(node) case types._try: return this.parseTryStatement(node) case types._const: case types._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) case types._while: return this.parseWhileStatement(node) case types._with: return this.parseWithStatement(node) case types.braceL: return this.parseBlock(true, node) case types.semi: return this.parseEmptyStatement(node) case types._export: case types._import: if (this.options.ecmaVersion > 10 && starttype === types._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); if (nextCh === 40 || nextCh === 46) // '(' or '.' { return this.parseExpressionStatement(node, this.parseExpression()) } } if (!this.options.allowImportExportEverywhere) { if (!topLevel) { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We // simply start parsing an expression, and afterwards, if the // next token is a colon and the expression was a simple // Identifier node, we switch to interpreting it as a label. default: if (this.isAsyncFunction()) { if (context) { this.unexpected(); } this.next(); return this.parseFunctionStatement(node, true, !context) } var maybeName = this.value, expr = this.parseExpression(); if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; pp$1.parseBreakContinueStatement = function(node, keyword) { var isBreak = keyword === "break"; this.next(); if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } else if (this.type !== types.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); } // Verify that there is an actual destination to break or // continue to. var i = 0; for (; i < this.labels.length; ++i) { var lab = this.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } if (node.label && isBreak) { break } } } if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; pp$1.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; pp$1.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); this.expect(types._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) { this.eat(types.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") }; // Disambiguating between a `for` and a `for`/`in` or `for`/`of` // loop is non-trivial. Basically, we have to parse the init `var` // statement or expression, disallowing the `in` operator (see // the second parameter to `parseExpression`), and then check // whether the next token is `in` or `of`. When there is no init // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. pp$1.parseForStatement = function(node) { this.next(); var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); this.expect(types.parenL); if (this.type === types.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); if (this.type === types._var || this.type === types._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { if (this.type === types._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } return this.parseForIn(node, init$1) } if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } var startsWithLet = this.isContextual("let"), isForOf = false; var refDestructuringErrors = new DestructuringErrors; var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); if (this.type === types._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { if (this.type === types._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } this.toAssignable(init, false, refDestructuringErrors); this.checkLValPattern(init); return this.parseForIn(node, init) } else { this.checkExpressionErrors(refDestructuringErrors, true); } if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init) }; pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; pp$1.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; pp$1.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); // In `return` (and `break`/`continue`), the keywords with // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; pp$1.parseSwitchStatement = function(node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; this.expect(types.braceL); this.labels.push(switchLabel); this.enterScope(0); // Statements under must be grouped (by label) in SwitchCase // nodes. `cur` is used to keep the node that we are currently // adding statements to. var cur; for (var sawDefault = false; this.type !== types.braceR;) { if (this.type === types._case || this.type === types._default) { var isCase = this.type === types._case; if (cur) { this.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this.startNode()); cur.consequent = []; this.next(); if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } sawDefault = true; cur.test = null; } this.expect(types.colon); } else { if (!cur) { this.unexpected(); } cur.consequent.push(this.parseStatement(null)); } } this.exitScope(); if (cur) { this.finishNode(cur, "SwitchCase"); } this.next(); // Closing brace this.labels.pop(); return this.finishNode(node, "SwitchStatement") }; pp$1.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement") }; // Reused empty array added for node fields that are always empty. var empty = []; pp$1.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.type === types._catch) { var clause = this.startNode(); this.next(); if (this.eat(types.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); this.expect(types.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; this.enterScope(0); } clause.body = this.parseBlock(false); this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; pp$1.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; pp$1.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); node.body = this.parseStatement("while"); this.labels.pop(); return this.finishNode(node, "WhileStatement") }; pp$1.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); node.body = this.parseStatement("with"); return this.finishNode(node, "WithStatement") }; pp$1.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; if (label$1.statementStart === node.start) { // Update information about previous labels on this node label$1.statementStart = this.start; label$1.kind = kind; } else { break } } this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); this.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement") }; pp$1.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") }; // Parse a semicolon-enclosed block of statements, handling `"use // strict"` declarations when `allowStrict` is true (used for // function bodies). pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; this.expect(types.braceL); if (createNewLexicalScope) { this.enterScope(0); } while (this.type !== types.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } if (exitStrict) { this.strict = false; } this.next(); if (createNewLexicalScope) { this.exitScope(); } return this.finishNode(node, "BlockStatement") }; // Parse a regular `for` loop. The disambiguation code in // `parseStatement` will already have parsed the init statement or // expression. pp$1.parseFor = function(node, init) { node.init = init; this.expect(types.semi); node.test = this.type === types.semi ? null : this.parseExpression(); this.expect(types.semi); node.update = this.type === types.parenR ? null : this.parseExpression(); this.expect(types.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); return this.finishNode(node, "ForStatement") }; // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. pp$1.parseForIn = function(node, init) { var isForIn = this.type === types._in; this.next(); if ( init.type === "VariableDeclaration" && init.declarations[0].init != null && ( !isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier" ) ) { this.raise( init.start, ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") ); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); this.expect(types.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") }; // Parse a list of variable declarations. pp$1.parseVar = function(node, isFor, kind) { node.declarations = []; node.kind = kind; for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); if (this.eat(types.eq)) { decl.init = this.parseMaybeAssign(isFor); } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected(); } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this.finishNode(decl, "VariableDeclarator")); if (!this.eat(types.comma)) { break } } return node }; pp$1.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(); this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; // Parse a function declaration or literal (depending on the // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } node.generator = this.eat(types.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding // mode depends on properties of the current scope (see // treatFunctionsAsVar). { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) { node.id = this.type === types.name ? this.parseIdent() : null; } this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; pp$1.parseFunctionParams = function(node) { this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). pp$1.parseClass = function(node, isStatement) { this.next(); // ecma-262 14.6 Class Definitions // A class definition is always strict mode code. var oldStrict = this.strict; this.strict = true; this.parseClassId(node, isStatement); this.parseClassSuper(node); var privateNameMap = this.enterClassBody(); var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; this.expect(types.braceL); while (this.type !== types.braceR) { var element = this.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); if (element.type === "MethodDefinition" && element.kind === "constructor") { if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } hadConstructor = true; } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); } } } this.strict = oldStrict; this.next(); node.body = this.finishNode(classBody, "ClassBody"); this.exitClassBody(); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; pp$1.parseClassElement = function(constructorAllowsSuper) { if (this.eat(types.semi)) { return null } var ecmaVersion = this.options.ecmaVersion; var node = this.startNode(); var keyName = ""; var isGenerator = false; var isAsync = false; var kind = "method"; var isStatic = false; if (this.eatContextual("static")) { // Parse static init block if (ecmaVersion >= 13 && this.eat(types.braceL)) { this.parseClassStaticBlock(node); return node } if (this.isClassElementNameStart() || this.type === types.star) { isStatic = true; } else { keyName = "static"; } } node.static = isStatic; if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { if ((this.isClassElementNameStart() || this.type === types.star) && !this.canInsertSemicolon()) { isAsync = true; } else { keyName = "async"; } } if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types.star)) { isGenerator = true; } if (!keyName && !isAsync && !isGenerator) { var lastValue = this.value; if (this.eatContextual("get") || this.eatContextual("set")) { if (this.isClassElementNameStart()) { kind = lastValue; } else { keyName = lastValue; } } } // Parse element name if (keyName) { // 'async', 'get', 'set', or 'static' were not a keyword contextually. // The last token is any of those. Make it the element name. node.computed = false; node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); node.key.name = keyName; this.finishNode(node.key, "Identifier"); } else { this.parseClassElementName(node); } // Parse element value if (ecmaVersion < 13 || this.type === types.parenL || kind !== "method" || isGenerator || isAsync) { var isConstructor = !node.static && checkKeyName(node, "constructor"); var allowsDirectSuper = isConstructor && constructorAllowsSuper; // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } node.kind = isConstructor ? "constructor" : kind; this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); } else { this.parseClassField(node); } return node }; pp$1.isClassElementNameStart = function() { return ( this.type === types.name || this.type === types.privateId || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword ) }; pp$1.parseClassElementName = function(element) { if (this.type === types.privateId) { if (this.value === "constructor") { this.raise(this.start, "Classes can't have an element named '#constructor'"); } element.computed = false; element.key = this.parsePrivateIdent(); } else { this.parsePropertyName(element); } }; pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { // Check key and flags var key = method.key; if (method.kind === "constructor") { if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } } else if (method.static && checkKeyName(method, "prototype")) { this.raise(key.start, "Classes may not have a static property named prototype"); } // Parse value var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); // Check value if (method.kind === "get" && value.params.length !== 0) { this.raiseRecoverable(value.start, "getter should have no params"); } if (method.kind === "set" && value.params.length !== 1) { this.raiseRecoverable(value.start, "setter should have exactly one param"); } if (method.kind === "set" && value.params[0].type === "RestElement") { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } return this.finishNode(method, "MethodDefinition") }; pp$1.parseClassField = function(field) { if (checkKeyName(field, "constructor")) { this.raise(field.key.start, "Classes can't have a field named 'constructor'"); } else if (field.static && checkKeyName(field, "prototype")) { this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); } if (this.eat(types.eq)) { // To raise SyntaxError if 'arguments' exists in the initializer. var scope = this.currentThisScope(); var inClassFieldInit = scope.inClassFieldInit; scope.inClassFieldInit = true; field.value = this.parseMaybeAssign(); scope.inClassFieldInit = inClassFieldInit; } else { field.value = null; } this.semicolon(); return this.finishNode(field, "PropertyDefinition") }; pp$1.parseClassStaticBlock = function(node) { node.body = []; var oldLabels = this.labels; this.labels = []; this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); while (this.type !== types.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } this.next(); this.exitScope(); this.labels = oldLabels; return this.finishNode(node, "StaticBlock") }; pp$1.parseClassId = function(node, isStatement) { if (this.type === types.name) { node.id = this.parseIdent(); if (isStatement) { this.checkLValSimple(node.id, BIND_LEXICAL, false); } } else { if (isStatement === true) { this.unexpected(); } node.id = null; } }; pp$1.parseClassSuper = function(node) { node.superClass = this.eat(types._extends) ? this.parseExprSubscripts(false) : null; }; pp$1.enterClassBody = function() { var element = {declared: Object.create(null), used: []}; this.privateNameStack.push(element); return element.declared }; pp$1.exitClassBody = function() { var ref = this.privateNameStack.pop(); var declared = ref.declared; var used = ref.used; var len = this.privateNameStack.length; var parent = len === 0 ? null : this.privateNameStack[len - 1]; for (var i = 0; i < used.length; ++i) { var id = used[i]; if (!has(declared, id.name)) { if (parent) { parent.used.push(id); } else { this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); } } } }; function isPrivateNameConflicted(privateNameMap, element) { var name = element.key.name; var curr = privateNameMap[name]; var next = "true"; if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { next = (element.static ? "s" : "i") + element.kind; } // `class { get #a(){}; static set #a(_){} }` is also conflict. if ( curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget" ) { privateNameMap[name] = "true"; return false } else if (!curr) { privateNameMap[name] = next; return false } else { return true } } function checkKeyName(node, name) { var computed = node.computed; var key = node.key; return !computed && ( key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name ) } // Parses module export declaration. pp$1.parseExport = function(node, exports) { this.next(); // export * from '...' if (this.eat(types.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { node.exported = this.parseIdent(true); this.checkExport(exports, node.exported.name, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); if (this.type !== types.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } if (this.eat(types._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; if (this.type === types._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === types._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { node.declaration = this.parseMaybeAssign(); this.semicolon(); } return this.finishNode(node, "ExportDefaultDeclaration") } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { node.declaration = this.parseStatement(null); if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { if (this.type !== types.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { // check for keywords used as local names var spec = list[i]; this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); } node.source = null; } this.semicolon(); } return this.finishNode(node, "ExportNamedDeclaration") }; pp$1.checkExport = function(exports, name, pos) { if (!exports) { return } if (has(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; pp$1.checkPatternExport = function(exports, pat) { var type = pat.type; if (type === "Identifier") { this.checkExport(exports, pat.name, pat.start); } else if (type === "ObjectPattern") { for (var i = 0, list = pat.properties; i < list.length; i += 1) { var prop = list[i]; this.checkPatternExport(exports, prop); } } else if (type === "ArrayPattern") { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { var elt = list$1[i$1]; if (elt) { this.checkPatternExport(exports, elt); } } } else if (type === "Property") { this.checkPatternExport(exports, pat.value); } else if (type === "AssignmentPattern") { this.checkPatternExport(exports, pat.left); } else if (type === "RestElement") { this.checkPatternExport(exports, pat.argument); } else if (type === "ParenthesizedExpression") { this.checkPatternExport(exports, pat.expression); } }; pp$1.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { var decl = list[i]; this.checkPatternExport(exports, decl.id); } }; pp$1.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction() }; // Parses a comma-separated list of module exports. pp$1.parseExportSpecifiers = function(exports) { var nodes = [], first = true; // export { x, y as z } [from '...'] this.expect(types.braceL); while (!this.eat(types.braceR)) { if (!first) { this.expect(types.comma); if (this.afterTrailingComma(types.braceR)) { break } } else { first = false; } var node = this.startNode(); node.local = this.parseIdent(true); node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; this.checkExport(exports, node.exported.name, node.exported.start); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes }; // Parses import declaration. pp$1.parseImport = function(node) { this.next(); // import '...' if (this.type === types.string) { node.specifiers = empty; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") }; // Parses a comma-separated list of module imports. pp$1.parseImportSpecifiers = function() { var nodes = [], first = true; if (this.type === types.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); if (!this.eat(types.comma)) { return nodes } } if (this.type === types.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); node$1.local = this.parseIdent(); this.checkLValSimple(node$1.local, BIND_LEXICAL); nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } this.expect(types.braceL); while (!this.eat(types.braceR)) { if (!first) { this.expect(types.comma); if (this.afterTrailingComma(types.braceR)) { break } } else { first = false; } var node$2 = this.startNode(); node$2.imported = this.parseIdent(true); if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { this.checkUnreserved(node$2.imported); node$2.local = node$2.imported; } this.checkLValSimple(node$2.local, BIND_LEXICAL); nodes.push(this.finishNode(node$2, "ImportSpecifier")); } return nodes }; // Set `ExpressionStatement#directive` property for directive prologues. pp$1.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; pp$1.isDirectiveCandidate = function(statement) { return ( statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && // Reject parenthesized strings. (this.input[statement.start] === "\"" || this.input[statement.start] === "'") ) }; var pp$2 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": if (this.inAsync && node.name === "await") { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } break case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": break case "ObjectExpression": node.type = "ObjectPattern"; if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } for (var i = 0, list = node.properties; i < list.length; i += 1) { var prop = list[i]; this.toAssignable(prop, isBinding); // Early error: // AssignmentRestProperty[Yield, Await] : // `...` DestructuringAssignmentTarget[Yield, Await] // // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. if ( prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") ) { this.raise(prop.argument.start, "Unexpected token"); } } break case "Property": // AssignmentProperty has type === "Property" if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } this.toAssignable(node.value, isBinding); break case "ArrayExpression": node.type = "ArrayPattern"; if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } this.toAssignableList(node.elements, isBinding); break case "SpreadElement": node.type = "RestElement"; this.toAssignable(node.argument, isBinding); if (node.argument.type === "AssignmentPattern") { this.raise(node.argument.start, "Rest elements cannot have a default value"); } break case "AssignmentExpression": if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isBinding); break case "ParenthesizedExpression": this.toAssignable(node.expression, isBinding, refDestructuringErrors); break case "ChainExpression": this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); break case "MemberExpression": if (!isBinding) { break } default: this.raise(node.start, "Assigning to rvalue"); } } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } return node }; // Convert list of expression atoms to binding list. pp$2.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; if (elt) { this.toAssignable(elt, isBinding); } } if (end) { var last = exprList[end - 1]; if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { this.unexpected(last.argument.start); } } return exprList }; // Parses spread element. pp$2.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; pp$2.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier if (this.options.ecmaVersion === 6 && this.type !== types.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement") }; // Parses lvalue (assignable) atom. pp$2.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { case types.bracketL: var node = this.startNode(); this.next(); node.elements = this.parseBindingList(types.bracketR, true, true); return this.finishNode(node, "ArrayPattern") case types.braceL: return this.parseObj(true) } } return this.parseIdent() }; pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(types.comma); } if (allowEmpty && this.type === types.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { break } else if (this.type === types.ellipsis) { var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } this.expect(close); break } else { var elem = this.parseMaybeDefault(this.start, this.startLoc); this.parseBindingListItem(elem); elts.push(elem); } } return elts }; pp$2.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. pp$2.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentPattern") }; // The following three functions all verify that a node is an lvalue — // something that can be bound, or assigned to. In order to do so, they perform // a variety of checks: // // - Check that none of the bound/assigned-to identifiers are reserved words. // - Record name declarations for bindings in the appropriate scope. // - Check duplicate argument names, if checkClashes is set. // // If a complex binding pattern is encountered (e.g., object and array // destructuring), the entire pattern is recursively checked. // // There are three versions of checkLVal*() appropriate for different // circumstances: // // - checkLValSimple() shall be used if the syntactic construct supports // nothing other than identifiers and member expressions. Parenthesized // expressions are also correctly handled. This is generally appropriate for // constructs for which the spec says // // > It is a Syntax Error if AssignmentTargetType of [the production] is not // > simple. // // It is also appropriate for checking if an identifier is valid and not // defined elsewhere, like import declarations or function/class identifiers. // // Examples where this is used include: // a += …; // import a from '…'; // where a is the node to be checked. // // - checkLValPattern() shall be used if the syntactic construct supports // anything checkLValSimple() supports, as well as object and array // destructuring patterns. This is generally appropriate for constructs for // which the spec says // // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor // > an ArrayLiteral and AssignmentTargetType of [the production] is not // > simple. // // Examples where this is used include: // (a = …); // const a = …; // try { … } catch (a) { … } // where a is the node to be checked. // // - checkLValInnerPattern() shall be used if the syntactic construct supports // anything checkLValPattern() supports, as well as default assignment // patterns, rest elements, and other constructs that may appear within an // object or array destructuring pattern. // // As a special case, function parameters also use checkLValInnerPattern(), // as they also support defaults and rest constructs. // // These functions deliberately support both assignment and binding constructs, // as the logic for both is exceedingly similar. If the node is the target of // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it // should be set to the appropriate BIND_* constant, like BIND_VAR or // BIND_LEXICAL. // // If the function is called with a non-BIND_NONE bindingType, then // additionally a checkClashes object may be specified to allow checking for // duplicate argument names. checkClashes is ignored if the provided construct // is an assignment (i.e., bindingType is BIND_NONE). pp$2.checkLValSimple = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; var isBind = bindingType !== BIND_NONE; switch (expr.type) { case "Identifier": if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } if (isBind) { if (bindingType === BIND_LEXICAL && expr.name === "let") { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } if (checkClashes) { if (has(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } checkClashes[expr.name] = true; } if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } } break case "ChainExpression": this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); break case "MemberExpression": if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } break case "ParenthesizedExpression": if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } return this.checkLValSimple(expr.expression, bindingType, checkClashes) default: this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); } }; pp$2.checkLValPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { case "ObjectPattern": for (var i = 0, list = expr.properties; i < list.length; i += 1) { var prop = list[i]; this.checkLValInnerPattern(prop, bindingType, checkClashes); } break case "ArrayPattern": for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { var elem = list$1[i$1]; if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } } break default: this.checkLValSimple(expr, bindingType, checkClashes); } }; pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; switch (expr.type) { case "Property": // AssignmentProperty has type === "Property" this.checkLValInnerPattern(expr.value, bindingType, checkClashes); break case "AssignmentPattern": this.checkLValPattern(expr.left, bindingType, checkClashes); break case "RestElement": this.checkLValPattern(expr.argument, bindingType, checkClashes); break default: this.checkLValPattern(expr, bindingType, checkClashes); } }; // The algorithm used to determine whether a regexp can appear at a var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { this.token = token; this.isExpr = !!isExpr; this.preserveSpace = !!preserveSpace; this.override = override; this.generator = !!generator; }; var types$1 = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), b_tmpl: new TokContext("${", false), p_stat: new TokContext("(", false), p_expr: new TokContext("(", true), q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), f_stat: new TokContext("function", false), f_expr: new TokContext("function", true), f_expr_gen: new TokContext("function", true, false, null, true), f_gen: new TokContext("function", false, false, null, true) }; var pp$3 = Parser.prototype; pp$3.initialContext = function() { return [types$1.b_stat] }; pp$3.curContext = function() { return this.context[this.context.length - 1] }; pp$3.braceIsBlock = function(prevType) { var parent = this.curContext(); if (parent === types$1.f_expr || parent === types$1.f_stat) { return true } if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) { return !parent.isExpr } // The check for `tt.name && exprAllowed` detects whether we are // after a `yield` or `of` construct. See the `updateContext` for // `tt.name`. if (prevType === types._return || prevType === types.name && this.exprAllowed) { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) { return true } if (prevType === types.braceL) { return parent === types$1.b_stat } if (prevType === types._var || prevType === types._const || prevType === types.name) { return false } return !this.exprAllowed }; pp$3.inGeneratorContext = function() { for (var i = this.context.length - 1; i >= 1; i--) { var context = this.context[i]; if (context.token === "function") { return context.generator } } return false }; pp$3.updateContext = function(prevType) { var update, type = this.type; if (type.keyword && prevType === types.dot) { this.exprAllowed = false; } else if (update = type.updateContext) { update.call(this, prevType); } else { this.exprAllowed = type.beforeExpr; } }; // Used to handle egde case when token context could not be inferred correctly in tokenize phase pp$3.overrideContext = function(tokenCtx) { if (this.curContext() !== tokenCtx) { this.context[this.context.length - 1] = tokenCtx; } }; // Token-specific context update code types.parenR.updateContext = types.braceR.updateContext = function() { if (this.context.length === 1) { this.exprAllowed = true; return } var out = this.context.pop(); if (out === types$1.b_stat && this.curContext().token === "function") { out = this.context.pop(); } this.exprAllowed = !out.isExpr; }; types.braceL.updateContext = function(prevType) { this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); this.exprAllowed = true; }; types.dollarBraceL.updateContext = function() { this.context.push(types$1.b_tmpl); this.exprAllowed = true; }; types.parenL.updateContext = function(prevType) { var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); this.exprAllowed = true; }; types.incDec.updateContext = function() { // tokExprAllowed stays unchanged }; types._function.updateContext = types._class.updateContext = function(prevType) { if (prevType.beforeExpr && prevType !== types._else && !(prevType === types.semi && this.curContext() !== types$1.p_stat) && !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) { this.context.push(types$1.f_expr); } else { this.context.push(types$1.f_stat); } this.exprAllowed = false; }; types.backQuote.updateContext = function() { if (this.curContext() === types$1.q_tmpl) { this.context.pop(); } else { this.context.push(types$1.q_tmpl); } this.exprAllowed = false; }; types.star.updateContext = function(prevType) { if (prevType === types._function) { var index = this.context.length - 1; if (this.context[index] === types$1.f_expr) { this.context[index] = types$1.f_expr_gen; } else { this.context[index] = types$1.f_gen; } } this.exprAllowed = true; }; types.name.updateContext = function(prevType) { var allowed = false; if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { allowed = true; } } this.exprAllowed = allowed; }; // A recursive descent parser operates by defining functions for all var pp$4 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. pp$4.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { return } var key = prop.key; var name; switch (key.type) { case "Identifier": name = key.name; break case "Literal": name = String(key.value); break default: return } var kind = prop.kind; if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors) { if (refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } // Backwards-compat kludge. Can be removed in version 6.0 } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } } propHash.proto = true; } return } name = "$" + name; var other = propHash[name]; if (other) { var redefinition; if (kind === "init") { redefinition = this.strict && other.init || other.get || other.set; } else { redefinition = other.init || other[kind]; } if (redefinition) { this.raiseRecoverable(key.start, "Redefinition of property"); } } else { other = propHash[name] = { init: false, get: false, set: false }; } other[kind] = true; }; // ### Expression parsing // These nest, from the most general expression type at the top to // 'atomic', nondivisible expression types at the bottom. Most of // the functions will simply let the function(s) below them parse, // and, *if* the syntactic construct they handle is present, wrap // the AST node that the inner parser gave them in another node. // Parse a full expression. The optional arguments are used to // forbid the `in` operator (in for loops initalization expressions) // and provide reference for storing '=' operator inside shorthand // property assignment in contexts where both object expression // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). pp$4.parseExpression = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); if (this.type === types.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr }; // Parse an assignment expression. This includes applications of // operators like `+=`. pp$4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(forInit) } // The tokenizer will assume an expression is allowed after // `yield`, but this isn't that kind of yield else { this.exprAllowed = false; } } var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; } else { refDestructuringErrors = new DestructuringErrors; ownDestructuringErrors = true; } var startPos = this.start, startLoc = this.startLoc; if (this.type === types.parenL || this.type === types.name) { this.potentialArrowAt = this.start; this.potentialArrowInForAwait = forInit === "await"; } var left = this.parseMaybeConditional(forInit, refDestructuringErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; if (this.type === types.eq) { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly if (this.type === types.eq) { this.checkLValPattern(left); } else { this.checkLValSimple(left); } node.left = left; this.next(); node.right = this.parseMaybeAssign(forInit); return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } } if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } return left }; // Parse a ternary conditional (`?:`) operator. pp$4.parseMaybeConditional = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprOps(forInit, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } if (this.eat(types.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); this.expect(types.colon); node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression") } return expr }; // Start the precedence parser. pp$4.parseExprOps = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) }; // Parse binary operators with the operator precedence parsing // algorithm. `left` is the left-hand side of the operator. // `minPrec` provides context that allows the function to stop and // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. pp$4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; if (prec != null && (!forInit || this.type !== types._in)) { if (prec > minPrec) { var logical = this.type === types.logicalOR || this.type === types.logicalAND; var coalesce = this.type === types.coalesce; if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. prec = types.logicalAND.binop; } var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) } } return left }; pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; node.right = right; return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") }; // Parse unary operators, both prefix and postfix. pp$4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, startLoc = this.startLoc, expr; if (this.isContextual("await") && this.canAwait) { expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { var node = this.startNode(), update = this.type === types.incDec; node.operator = this.value; node.prefix = true; this.next(); node.argument = this.parseMaybeUnary(null, true, update, forInit); this.checkExpressionErrors(refDestructuringErrors, true); if (update) { this.checkLValSimple(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else { expr = this.parseExprSubscripts(refDestructuringErrors, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } while (this.type.postfix && !this.canInsertSemicolon()) { var node$1 = this.startNodeAt(startPos, startLoc); node$1.operator = this.value; node$1.prefix = false; node$1.argument = expr; this.checkLValSimple(expr); this.next(); expr = this.finishNode(node$1, "UpdateExpression"); } } if (!incDec && this.eat(types.starstar)) { if (sawUnary) { this.unexpected(this.lastTokStart); } else { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } } else { return expr } }; function isPrivateFieldAccess(node) { return ( node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ) } // Parse call, dot, and `[]`-subscript expressions. pp$4.parseExprSubscripts = function(refDestructuringErrors, forInit) { var startPos = this.start, startLoc = this.startLoc; var expr = this.parseExprAtom(refDestructuringErrors, forInit); if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { return expr } var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); if (refDestructuringErrors && result.type === "MemberExpression") { if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } } return result }; pp$4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; var optionalChained = false; while (true) { var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); if (element.optional) { optionalChained = true; } if (element === base || element.type === "ArrowFunctionExpression") { if (optionalChained) { var chainNode = this.startNodeAt(startPos, startLoc); chainNode.expression = element; element = this.finishNode(chainNode, "ChainExpression"); } return element } base = element; } }; pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; var optional = optionalSupported && this.eat(types.questionDot); if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } var computed = this.eat(types.bracketL); if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; if (computed) { node.property = this.parseExpression(); this.expect(types.bracketR); } else if (this.type === types.privateId && base.type !== "Super") { node.property = this.parsePrivateIdent(); } else { node.property = this.parseIdent(this.options.allowReserved !== "never"); } node.computed = !!computed; if (optionalSupported) { node.optional = optional; } base = this.finishNode(node, "MemberExpression"); } else if (!noCalls && this.eat(types.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; var node$1 = this.startNodeAt(startPos, startLoc); node$1.callee = base; node$1.arguments = exprList; if (optionalSupported) { node$1.optional = optional; } base = this.finishNode(node$1, "CallExpression"); } else if (this.type === types.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } var node$2 = this.startNodeAt(startPos, startLoc); node$2.tag = base; node$2.quasi = this.parseTemplate({isTagged: true}); base = this.finishNode(node$2, "TaggedTemplateExpression"); } return base }; // Parse an atomic expression — either a single token that is an // expression, an expression started by a keyword like `function` or // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. pp$4.parseExprAtom = function(refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. if (this.type === types.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { case types._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); if (this.type === types.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: // super [ Expression ] // super . IdentifierName // SuperCall: // super ( Arguments ) if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) { this.unexpected(); } return this.finishNode(node, "Super") case types._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") case types.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) { this.overrideContext(types$1.f_expr); return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) } if (canBeArrow && !this.canInsertSemicolon()) { if (this.eat(types.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); if (this.canInsertSemicolon() || !this.eat(types.arrow)) { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) } } return id case types.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node case types.num: case types.string: return this.parseLiteral(this.value) case types._null: case types._true: case types._false: node = this.startNode(); node.value = this.type === types._null ? null : this.type === types._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") case types.parenL: var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { refDestructuringErrors.parenthesizedAssign = start; } if (refDestructuringErrors.parenthesizedBind < 0) { refDestructuringErrors.parenthesizedBind = start; } } return expr case types.bracketL: node = this.startNode(); this.next(); node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") case types.braceL: this.overrideContext(types$1.b_expr); return this.parseObj(false, refDestructuringErrors) case types._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) case types._class: return this.parseClass(this.startNode(), false) case types._new: return this.parseNew() case types.backQuote: return this.parseTemplate() case types._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport() } else { return this.unexpected() } default: this.unexpected(); } }; pp$4.parseExprImport = function() { var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } var meta = this.parseIdent(true); switch (this.type) { case types.parenL: return this.parseDynamicImport(node) case types.dot: node.meta = meta; return this.parseImportMeta(node) default: this.unexpected(); } }; pp$4.parseDynamicImport = function(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); // Verify ending. if (!this.eat(types.parenR)) { var errorPos = this.start; if (this.eat(types.comma) && this.eat(types.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); } } return this.finishNode(node, "ImportExpression") }; pp$4.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; node.property = this.parseIdent(true); if (node.property.name !== "meta") { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } if (containsEsc) { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } return this.finishNode(node, "MetaProperty") }; pp$4.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } this.next(); return this.finishNode(node, "Literal") }; pp$4.parseParenExpression = function() { this.expect(types.parenL); var val = this.parseExpression(); this.expect(types.parenR); return val }; pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); var innerStartPos = this.start, innerStartLoc = this.startLoc; var exprList = [], first = true, lastIsComma = false; var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters while (this.type !== types.parenR) { first ? first = false : this.expect(types.comma); if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { lastIsComma = true; break } else if (this.type === types.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; this.expect(types.parenR); if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; return this.parseParenArrowList(startPos, startLoc, exprList, forInit) } if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } if (spreadStart) { this.unexpected(spreadStart); } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; if (exprList.length > 1) { val = this.startNodeAt(innerStartPos, innerStartLoc); val.expressions = exprList; this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); } else { val = exprList[0]; } } else { val = this.parseParenExpression(); } if (this.options.preserveParens) { var par = this.startNodeAt(startPos, startLoc); par.expression = val; return this.finishNode(par, "ParenthesizedExpression") } else { return val } }; pp$4.parseParenItem = function(item) { return item }; pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, forInit) }; // New's precedence is slightly tricky. It must allow its argument to // be a `[]` or dot subscript expression, but not a call — at least, // not without wrapping it in parentheses. Thus, it uses the noCalls // argument to parseSubscripts to prevent it from consuming the // argument list. var empty$1 = []; pp$4.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); if (node.property.name !== "target") { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } if (containsEsc) { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } if (!this.allowNewDotTarget) { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } return this.finishNode(node, "MetaProperty") } var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } else { node.arguments = empty$1; } return this.finishNode(node, "NewExpression") }; // Parse template expression. pp$4.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); if (this.type === types.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } elem.value = { raw: this.value, cooked: null }; } else { elem.value = { raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), cooked: this.value }; } this.next(); elem.tail = this.type === types.backQuote; return this.finishNode(elem, "TemplateElement") }; pp$4.parseTemplate = function(ref) { if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; var node = this.startNode(); this.next(); node.expressions = []; var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } this.expect(types.dollarBraceL); node.expressions.push(this.parseExpression()); this.expect(types.braceR); node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; pp$4.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. pp$4.parseObj = function(isPattern, refDestructuringErrors) { var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); while (!this.eat(types.braceR)) { if (!first) { this.expect(types.comma); if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } } else { first = false; } var prop = this.parseProperty(isPattern, refDestructuringErrors); if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } node.properties.push(prop); } return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; pp$4.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } // To disallow parenthesized identifier via `this.toAssignable()`. if (this.type === types.parenL && refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0) { refDestructuringErrors.parenthesizedAssign = this.start; } if (refDestructuringErrors.parenthesizedBind < 0) { refDestructuringErrors.parenthesizedBind = this.start; } } // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish return this.finishNode(prop, "SpreadElement") } if (this.options.ecmaVersion >= 6) { prop.method = false; prop.shorthand = false; if (isPattern || refDestructuringErrors) { startPos = this.start; startLoc = this.startLoc; } if (!isPattern) { isGenerator = this.eat(types.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); this.parsePropertyName(prop, refDestructuringErrors); } else { isAsync = false; } this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); return this.finishNode(prop, "Property") }; pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { if ((isGenerator || isAsync) && this.type === types.colon) { this.unexpected(); } if (this.eat(types.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; prop.value = this.parseMethod(isGenerator, isAsync); } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); prop.value = this.parseMethod(false); var paramCount = prop.kind === "get" ? 0 : 1; if (prop.value.params.length !== paramCount) { var start = prop.value.start; if (prop.kind === "get") { this.raiseRecoverable(start, "getter should have no params"); } else { this.raiseRecoverable(start, "setter should have exactly one param"); } } else { if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } } } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { if (isGenerator || isAsync) { this.unexpected(); } this.checkUnreserved(prop.key); if (prop.key.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = startPos; } prop.kind = "init"; if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else if (this.type === types.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else { prop.value = this.copyNode(prop.key); } prop.shorthand = true; } else { this.unexpected(); } }; pp$4.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { if (this.eat(types.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); this.expect(types.bracketR); return prop.key } else { prop.computed = false; } } return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. pp$4.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } }; // Parse object or class method. pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); if (this.options.ecmaVersion >= 6) { node.generator = isGenerator; } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); this.expect(types.parenL); node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); this.parseFunctionBody(node, false, true, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "FunctionExpression") }; // Parse arrow function expression with given parameters. pp$4.parseArrowExpression = function(node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node); if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; node.params = this.toAssignableList(params, true); this.parseFunctionBody(node, true, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "ArrowFunctionExpression") }; // Parse function body and check parameters. pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { var isExpression = isArrowFunction && this.type !== types.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { node.body = this.parseMaybeAssign(forInit); node.expression = true; this.checkParams(node, false); } else { var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); if (!oldStrict || nonSimple) { useStrict = this.strictDirective(this.end); // If this is a strict mode function, verify that argument names // are not repeated, and it does not try to bind the words `eval` // or `arguments`. if (useStrict && nonSimple) { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } } // Start a new scope with regard to labels and the `inFunction` // flag (restore them to their old value afterwards). var oldLabels = this.labels; this.labels = []; if (useStrict) { this.strict = true; } // Add the params to varDeclaredNames to ensure that an error is thrown // if a let/const declaration in the function clashes with one of the params. this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); node.expression = false; this.adaptDirectivePrologue(node.body.body); this.labels = oldLabels; } this.exitScope(); }; pp$4.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; if (param.type !== "Identifier") { return false } } return true }; // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. pp$4.checkParams = function(node, allowDuplicates) { var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { var param = list[i]; this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; // Parses a comma-separated list of expressions, and returns them as // an array. `close` is the token type that ends the list, and // `allowEmpty` can be turned on to allow subsequent commas with // nothing in between them to be parsed as `null` (which is needed // for array literals). pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], first = true; while (!this.eat(close)) { if (!first) { this.expect(types.comma); if (allowTrailingComma && this.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); if (allowEmpty && this.type === types.comma) { elt = null; } else if (this.type === types.ellipsis) { elt = this.parseSpread(refDestructuringErrors); if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); } elts.push(elt); } return elts }; pp$4.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; if (this.inGenerator && name === "yield") { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } if (this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } if (this.currentThisScope().inClassFieldInit && name === "arguments") { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { return } var re = this.strict ? this.reservedWordsStrict : this.reservedWords; if (re.test(name)) { if (!this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); } }; // Parse the next token as an identifier. If `liberal` is true (used // when parsing properties), it will also convert keywords into // identifiers. pp$4.parseIdent = function(liberal, isBinding) { var node = this.startNode(); if (this.type === types.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; // To fix https://github.com/acornjs/acorn/issues/575 // `class` and `function` keywords push new context into this.context. // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { this.context.pop(); } } else { this.unexpected(); } this.next(!!liberal); this.finishNode(node, "Identifier"); if (!liberal) { this.checkUnreserved(node); if (node.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = node.start; } } return node }; pp$4.parsePrivateIdent = function() { var node = this.startNode(); if (this.type === types.privateId) { node.name = this.value; } else { this.unexpected(); } this.next(); this.finishNode(node, "PrivateIdentifier"); // For validating existence if (this.privateNameStack.length === 0) { this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); } else { this.privateNameStack[this.privateNameStack.length - 1].used.push(node); } return node }; // Parses yield expression inside generator. pp$4.parseYield = function(forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { node.delegate = this.eat(types.star); node.argument = this.parseMaybeAssign(forInit); } return this.finishNode(node, "YieldExpression") }; pp$4.parseAwait = function(forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); this.next(); node.argument = this.parseMaybeUnary(null, true, false, forInit); return this.finishNode(node, "AwaitExpression") }; var pp$5 = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate // the location of the error, attaches the position to the end // of the error message, and then raises a `SyntaxError` with that // message. pp$5.raise = function(pos, message) { var loc = getLineInfo(this.input, pos); message += " (" + loc.line + ":" + loc.column + ")"; var err = new SyntaxError(message); err.pos = pos; err.loc = loc; err.raisedAt = this.pos; throw err }; pp$5.raiseRecoverable = pp$5.raise; pp$5.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) } }; var pp$6 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; // A list of var-declared names in the current lexical scope this.var = []; // A list of lexically-declared names in the current lexical scope this.lexical = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope this.functions = []; // A switch to disallow the identifier reference 'arguments' this.inClassFieldInit = false; }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. pp$6.enterScope = function(flags) { this.scopeStack.push(new Scope(flags)); }; pp$6.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. pp$6.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; pp$6.declareName = function(name, bindingType, pos) { var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; scope.lexical.push(name); if (this.inModule && (scope.flags & SCOPE_TOP)) { delete this.undefinedExports[name]; } } else if (bindingType === BIND_SIMPLE_CATCH) { var scope$1 = this.currentScope(); scope$1.lexical.push(name); } else if (bindingType === BIND_FUNCTION) { var scope$2 = this.currentScope(); if (this.treatFunctionsAsVar) { redeclared = scope$2.lexical.indexOf(name) > -1; } else { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } scope$2.functions.push(name); } else { for (var i = this.scopeStack.length - 1; i >= 0; --i) { var scope$3 = this.scopeStack[i]; if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { redeclared = true; break } scope$3.var.push(name); if (this.inModule && (scope$3.flags & SCOPE_TOP)) { delete this.undefinedExports[name]; } if (scope$3.flags & SCOPE_VAR) { break } } } if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; pp$6.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { this.undefinedExports[id.name] = id; } }; pp$6.currentScope = function() { return this.scopeStack[this.scopeStack.length - 1] }; pp$6.currentVarScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR) { return scope } } }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. pp$6.currentThisScope = function() { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } } }; var Node = function Node(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; if (parser.options.locations) { this.loc = new SourceLocation(parser, loc); } if (parser.options.directSourceFile) { this.sourceFile = parser.options.directSourceFile; } if (parser.options.ranges) { this.range = [pos, 0]; } }; // Start an AST node, attaching a start offset. var pp$7 = Parser.prototype; pp$7.startNode = function() { return new Node(this, this.start, this.startLoc) }; pp$7.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) }; // Finish an AST node, adding `type` and `end` properties. function finishNodeAt(node, type, pos, loc) { node.type = type; node.end = pos; if (this.options.locations) { node.loc.end = loc; } if (this.options.ranges) { node.range[1] = pos; } return node } pp$7.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; // Finish node at given position pp$7.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }; pp$7.copyNode = function(node) { var newNode = new Node(this, node.start, this.startLoc); for (var prop in node) { newNode[prop] = node[prop]; } return newNode }; // This file contains Unicode properties extracted from the ECMAScript // specification. The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) // #table-binary-unicode-properties var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, 12: ecma12BinaryProperties }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, 12: ecma12ScriptValues }; var data = {}; function buildUnicodeData(ecmaVersion) { var d = data[ecmaVersion] = { binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), nonBinary: { General_Category: wordsRegexp(unicodeGeneralCategoryValues), Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) } }; d.nonBinary.Script_Extensions = d.nonBinary.Script; d.nonBinary.gc = d.nonBinary.General_Category; d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } buildUnicodeData(9); buildUnicodeData(10); buildUnicodeData(11); buildUnicodeData(12); var pp$8 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; this.switchU = false; this.switchN = false; this.pos = 0; this.lastIntValue = 0; this.lastStringValue = ""; this.lastAssertionIsQuantifiable = false; this.numCapturingParens = 0; this.maxBackReference = 0; this.groupNames = []; this.backReferenceNames = []; }; RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { var unicode = flags.indexOf("u") !== -1; this.start = start | 0; this.source = pattern + ""; this.flags = flags; this.switchU = unicode && this.parser.options.ecmaVersion >= 6; this.switchN = unicode && this.parser.options.ecmaVersion >= 9; }; RegExpValidationState.prototype.raise = function raise (message) { this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); }; // If u flag is given, this returns the code point at the index (it combines a surrogate pair). // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). RegExpValidationState.prototype.at = function at (i, forceU) { if ( forceU === void 0 ) forceU = false; var s = this.source; var l = s.length; if (i >= l) { return -1 } var c = s.charCodeAt(i); if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { return c } var next = s.charCodeAt(i + 1); return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c }; RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { if ( forceU === void 0 ) forceU = false; var s = this.source; var l = s.length; if (i >= l) { return l } var c = s.charCodeAt(i), next; if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { return i + 1 } return i + 2 }; RegExpValidationState.prototype.current = function current (forceU) { if ( forceU === void 0 ) forceU = false; return this.at(this.pos, forceU) }; RegExpValidationState.prototype.lookahead = function lookahead (forceU) { if ( forceU === void 0 ) forceU = false; return this.at(this.nextIndex(this.pos, forceU), forceU) }; RegExpValidationState.prototype.advance = function advance (forceU) { if ( forceU === void 0 ) forceU = false; this.pos = this.nextIndex(this.pos, forceU); }; RegExpValidationState.prototype.eat = function eat (ch, forceU) { if ( forceU === void 0 ) forceU = false; if (this.current(forceU) === ch) { this.advance(forceU); return true } return false }; function codePointToString(ch) { if (ch <= 0xFFFF) { return String.fromCharCode(ch) } ch -= 0x10000; return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) } /** * Validate the flags part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ pp$8.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; for (var i = 0; i < flags.length; i++) { var flag = flags.charAt(i); if (validFlags.indexOf(flag) === -1) { this.raise(state.start, "Invalid regular expression flag"); } if (flags.indexOf(flag, i + 1) > -1) { this.raise(state.start, "Duplicate regular expression flag"); } } }; /** * Validate the pattern part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ pp$8.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of // parsing contains a |GroupName|, reparse with the goal symbol // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* // exception if _P_ did not conform to the grammar, if any elements of _P_ // were not matched by the parse, or if any Early Error conditions exist. if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { state.switchN = true; this.regexp_pattern(state); } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern pp$8.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; state.lastAssertionIsQuantifiable = false; state.numCapturingParens = 0; state.maxBackReference = 0; state.groupNames.length = 0; state.backReferenceNames.length = 0; this.regexp_disjunction(state); if (state.pos !== state.source.length) { // Make the same messages as V8. if (state.eat(0x29 /* ) */)) { state.raise("Unmatched ')'"); } if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { state.raise("Lone quantifier brackets"); } } if (state.maxBackReference > state.numCapturingParens) { state.raise("Invalid escape"); } for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { var name = list[i]; if (state.groupNames.indexOf(name) === -1) { state.raise("Invalid named capture referenced"); } } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction pp$8.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); } // Make the same message as V8. if (this.regexp_eatQuantifier(state, true)) { state.raise("Nothing to repeat"); } if (state.eat(0x7B /* { */)) { state.raise("Lone quantifier brackets"); } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative pp$8.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term pp$8.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion // is a QuantifiableAssertion. if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { // Make the same message as V8. if (state.switchU) { state.raise("Invalid quantifier"); } } return true } if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { this.regexp_eatQuantifier(state); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion pp$8.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; // ^, $ if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { return true } // \b \B if (state.eat(0x5C /* \ */)) { if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { return true } state.pos = start; } // Lookahead / Lookbehind if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { var lookbehind = false; if (this.options.ecmaVersion >= 9) { lookbehind = state.eat(0x3C /* < */); } if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { this.regexp_disjunction(state); if (!state.eat(0x29 /* ) */)) { state.raise("Unterminated group"); } state.lastAssertionIsQuantifiable = !lookbehind; return true } } state.pos = start; return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier pp$8.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { state.eat(0x3F /* ? */); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix pp$8.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || state.eat(0x3F /* ? */) || this.regexp_eatBracedQuantifier(state, noError) ) }; pp$8.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; if (this.regexp_eatDecimalDigits(state)) { min = state.lastIntValue; if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { max = state.lastIntValue; } if (state.eat(0x7D /* } */)) { // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term if (max !== -1 && max < min && !noError) { state.raise("numbers out of order in {} quantifier"); } return true } } if (state.switchU && !noError) { state.raise("Incomplete quantifier"); } state.pos = start; } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom pp$8.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) ) }; pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { return true } state.pos = start; } return false }; pp$8.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { this.regexp_disjunction(state); if (state.eat(0x29 /* ) */)) { return true } state.raise("Unterminated group"); } state.pos = start; } return false }; pp$8.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); } else if (state.current() === 0x3F /* ? */) { state.raise("Invalid group"); } this.regexp_disjunction(state); if (state.eat(0x29 /* ) */)) { state.numCapturingParens += 1; return true } state.raise("Unterminated group"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom pp$8.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state) ) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier pp$8.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter pp$8.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; state.advance(); return true } return false }; function isSyntaxCharacter(ch) { return ( ch === 0x24 /* $ */ || ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || ch === 0x2E /* . */ || ch === 0x3F /* ? */ || ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || ch >= 0x7B /* { */ && ch <= 0x7D /* } */ ) } // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. pp$8.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { state.advance(); } return state.pos !== start }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter pp$8.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && ch !== 0x24 /* $ */ && !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && ch !== 0x2E /* . */ && ch !== 0x3F /* ? */ && ch !== 0x5B /* [ */ && ch !== 0x5E /* ^ */ && ch !== 0x7C /* | */ ) { state.advance(); return true } return false }; // GroupSpecifier :: // [empty] // `?` GroupName pp$8.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { state.raise("Duplicate capture group name"); } state.groupNames.push(state.lastStringValue); return } state.raise("Invalid group"); } }; // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. pp$8.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { return true } state.raise("Invalid capture group name"); } return false }; // RegExpIdentifierName :: // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. pp$8.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); while (this.regexp_eatRegExpIdentifierPart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); } return true } return false }; // RegExpIdentifierStart :: // UnicodeIDStart // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] pp$8.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); state.advance(forceU); if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { ch = state.lastIntValue; } if (isRegExpIdentifierStart(ch)) { state.lastIntValue = ch; return true } state.pos = start; return false }; function isRegExpIdentifierStart(ch) { return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ } // RegExpIdentifierPart :: // UnicodeIDContinue // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] // // pp$8.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); state.advance(forceU); if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { ch = state.lastIntValue; } if (isRegExpIdentifierPart(ch)) { state.lastIntValue = ch; return true } state.pos = start; return false }; function isRegExpIdentifierPart(ch) { return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape pp$8.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || (state.switchN && this.regexp_eatKGroupName(state)) ) { return true } if (state.switchU) { // Make the same message as V8. if (state.current() === 0x63 /* c */) { state.raise("Invalid unicode escape"); } state.raise("Invalid escape"); } return false }; pp$8.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; if (state.switchU) { // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape if (n > state.maxBackReference) { state.maxBackReference = n; } return true } if (n <= state.numCapturingParens) { return true } state.pos = start; } return false }; pp$8.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); return true } state.raise("Invalid named reference"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape pp$8.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || this.regexp_eatIdentityEscape(state) ) }; pp$8.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { return true } state.pos = start; } return false }; pp$8.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape pp$8.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ state.advance(); return true } if (ch === 0x6E /* n */) { state.lastIntValue = 0x0A; /* \n */ state.advance(); return true } if (ch === 0x76 /* v */) { state.lastIntValue = 0x0B; /* \v */ state.advance(); return true } if (ch === 0x66 /* f */) { state.lastIntValue = 0x0C; /* \f */ state.advance(); return true } if (ch === 0x72 /* r */) { state.lastIntValue = 0x0D; /* \r */ state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter pp$8.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; state.advance(); return true } return false }; function isControlLetter(ch) { return ( (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) ) } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { if ( forceU === void 0 ) forceU = false; var start = state.pos; var switchU = forceU || state.switchU; if (state.eat(0x75 /* u */)) { if (this.regexp_eatFixedHexDigits(state, 4)) { var lead = state.lastIntValue; if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { var leadSurrogateEnd = state.pos; if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { var trail = state.lastIntValue; if (trail >= 0xDC00 && trail <= 0xDFFF) { state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; return true } } state.pos = leadSurrogateEnd; state.lastIntValue = lead; } return true } if ( switchU && state.eat(0x7B /* { */) && this.regexp_eatHexDigits(state) && state.eat(0x7D /* } */) && isValidUnicode(state.lastIntValue) ) { return true } if (switchU) { state.raise("Invalid unicode escape"); } state.pos = start; } return false }; function isValidUnicode(ch) { return ch >= 0 && ch <= 0x10FFFF } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape pp$8.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true } if (state.eat(0x2F /* / */)) { state.lastIntValue = 0x2F; /* / */ return true } return false } var ch = state.current(); if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { state.lastIntValue = ch; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape pp$8.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { do { state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape pp$8.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { state.lastIntValue = -1; state.advance(); return true } if ( state.switchU && this.options.ecmaVersion >= 9 && (ch === 0x50 /* P */ || ch === 0x70 /* p */) ) { state.lastIntValue = -1; state.advance(); if ( state.eat(0x7B /* { */) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(0x7D /* } */) ) { return true } state.raise("Invalid property name"); } return false }; function isCharacterClassEscape(ch) { return ( ch === 0x64 /* d */ || ch === 0x44 /* D */ || ch === 0x73 /* s */ || ch === 0x53 /* S */ || ch === 0x77 /* w */ || ch === 0x57 /* W */ ) } // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { var name = state.lastStringValue; if (this.regexp_eatUnicodePropertyValue(state)) { var value = state.lastStringValue; this.regexp_validateUnicodePropertyNameAndValue(state, name, value); return true } } state.pos = start; // LoneUnicodePropertyNameOrValue if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { var nameOrValue = state.lastStringValue; this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); return true } return false }; pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { if (!has(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters pp$8.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { state.lastStringValue += codePointToString(ch); state.advance(); } return state.lastStringValue !== "" }; function isUnicodePropertyNameCharacter(ch) { return isControlLetter(ch) || ch === 0x5F /* _ */ } // UnicodePropertyValue :: // UnicodePropertyValueCharacters pp$8.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { state.lastStringValue += codePointToString(ch); state.advance(); } return state.lastStringValue !== "" }; function isUnicodePropertyValueCharacter(ch) { return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) } // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass pp$8.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); if (state.eat(0x5D /* ] */)) { return true } // Unreachable since it threw "unterminated regular expression" error before. state.raise("Unterminated character class"); } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash pp$8.regexp_classRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { var right = state.lastIntValue; if (state.switchU && (left === -1 || right === -1)) { state.raise("Invalid character class"); } if (left !== -1 && right !== -1 && left > right) { state.raise("Range out of order in character class"); } } } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash pp$8.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatClassEscape(state)) { return true } if (state.switchU) { // Make the same message as V8. var ch$1 = state.current(); if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { state.raise("Invalid class escape"); } state.raise("Invalid escape"); } state.pos = start; } var ch = state.current(); if (ch !== 0x5D /* ] */) { state.lastIntValue = ch; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape pp$8.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { state.lastIntValue = 0x08; /* */ return true } if (state.switchU && state.eat(0x2D /* - */)) { state.lastIntValue = 0x2D; /* - */ return true } if (!state.switchU && state.eat(0x63 /* c */)) { if (this.regexp_eatClassControlLetter(state)) { return true } state.pos = start; } return ( this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) ) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter pp$8.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; state.advance(); return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence pp$8.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { return true } if (state.switchU) { state.raise("Invalid escape"); } state.pos = start; } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits pp$8.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; while (isDecimalDigit(ch = state.current())) { state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); } return state.pos !== start }; function isDecimalDigit(ch) { return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits pp$8.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; while (isHexDigit(ch = state.current())) { state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } return state.pos !== start }; function isHexDigit(ch) { return ( (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) ) } function hexToInt(ch) { if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { return 10 + (ch - 0x41 /* A */) } if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { return 10 + (ch - 0x61 /* a */) } return ch - 0x30 /* 0 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { var n2 = state.lastIntValue; if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; } else { state.lastIntValue = n1 * 8 + n2; } } else { state.lastIntValue = n1; } return true } return false }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit pp$8.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ state.advance(); return true } state.lastIntValue = 0; return false }; function isOctalDigit(ch) { return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ } // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence pp$8.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { var ch = state.current(); if (!isHexDigit(ch)) { state.pos = start; return false } state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } return true }; // Object type used to represent tokens. Note that normally, tokens // simply exist as properties on the parser object. This is only // used for the onToken callback and the external tokenizer. var Token = function Token(p) { this.type = p.type; this.value = p.value; this.start = p.start; this.end = p.end; if (p.options.locations) { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } if (p.options.ranges) { this.range = [p.start, p.end]; } }; // ## Tokenizer var pp$9 = Parser.prototype; // Move to the next token pp$9.next = function(ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } if (this.options.onToken) { this.options.onToken(new Token(this)); } this.lastTokEnd = this.end; this.lastTokStart = this.start; this.lastTokEndLoc = this.endLoc; this.lastTokStartLoc = this.startLoc; this.nextToken(); }; pp$9.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") { pp$9[Symbol.iterator] = function() { var this$1 = this; return { next: function () { var token = this$1.getToken(); return { done: token.type === types.eof, value: token } } } }; } // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). // Read a single token, updating the parser object's token-related // properties. pp$9.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } if (this.pos >= this.input.length) { return this.finishToken(types.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; pp$9.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) { return this.readWord() } return this.getTokenFromCode(code) }; pp$9.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); if (code <= 0xd7ff || code >= 0xdc00) { return code } var next = this.input.charCodeAt(this.pos + 1); return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 }; pp$9.skipBlockComment = function() { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { lineBreakG.lastIndex = start; var match; while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { ++this.curLine; this.lineStart = match.index + match[0].length; } } if (this.options.onComment) { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, startLoc, this.curPosition()); } }; pp$9.skipLineComment = function(startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); while (this.pos < this.input.length && !isNewLine(ch)) { ch = this.input.charCodeAt(++this.pos); } if (this.options.onComment) { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, startLoc, this.curPosition()); } }; // Called at the start of the parse and after every token. Skips // whitespace and comments, and. pp$9.skipSpace = function() { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); switch (ch) { case 32: case 160: // ' ' ++this.pos; break case 13: if (this.input.charCodeAt(this.pos + 1) === 10) { ++this.pos; } case 10: case 8232: case 8233: ++this.pos; if (this.options.locations) { ++this.curLine; this.lineStart = this.pos; } break case 47: // '/' switch (this.input.charCodeAt(this.pos + 1)) { case 42: // '*' this.skipBlockComment(); break case 47: this.skipLineComment(2); break default: break loop } break default: if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { ++this.pos; } else { break loop } } } }; // Called at the end of every token. Sets `end`, `val`, and // maintains `context` and `exprAllowed`, and skips the space after // the token, so that the next one's `start` will point at the // right position. pp$9.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; this.type = type; this.value = val; this.updateContext(prevType); }; // ### Token reading // This is the function that is called to fetch the next token. It // is somewhat obscure, because it works in character codes rather // than characters, and because operator parsing has been inlined // into it. // // All in the name of speed. // pp$9.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; return this.finishToken(types.ellipsis) } else { ++this.pos; return this.finishToken(types.dot) } }; pp$9.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.slash, 1) }; pp$9.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; var tokentype = code === 42 ? types.star : types.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; tokentype = types.starstar; next = this.input.charCodeAt(this.pos + 2); } if (next === 61) { return this.finishOp(types.assign, size + 1) } return this.finishOp(tokentype, size) }; pp$9.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (this.options.ecmaVersion >= 12) { var next2 = this.input.charCodeAt(this.pos + 2); if (next2 === 61) { return this.finishOp(types.assign, 3) } } return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) }; pp$9.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.bitwiseXOR, 1) }; pp$9.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { // A `-->` line comment this.skipLineComment(3); this.skipSpace(); return this.nextToken() } return this.finishOp(types.incDec, 2) } if (next === 61) { return this.finishOp(types.assign, 2) } return this.finishOp(types.plusMin, 1) }; pp$9.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } return this.finishOp(types.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { // ` NopSectionHeaderByte ShortStringSectionHeaderByte -> 0b1nnn_nnnn (n:length) F64NumbersSectionHeaderByte -> 0b001n_nnnn (n:count - 1) I32NumbersSectionHeaderByte -> 0b010n_nnnn (n:count - 1) I8NumbersSectionHeaderByte -> 0b011n_nnnn (n:count - 1) NullsSectionHeaderByte -> 0b0001_nnnn (n:count - 1) BooleansCountAndBitsByte -> 0b0000_1xxx (count = 3) | 0b0001_xxxx (count = 4) | 0b001x_xxxx (count = 5) | 0b01xx_xxxx (count = 6) | 0b1nnn_nnnn (n:count - 7, 7 <= count <= 133) 0xff n:ui32 (n:count, 134 <= count < 2^32) StringSectionHeaderByte -> 0b0000_1110 BufferSectionHeaderByte -> 0b0000_1111 NopSectionHeaderByte -> 0b0000_1011 FalseHeaderByte -> 0b0000_1100 TrueHeaderByte -> 0b0000_1101 RawNumber -> n (n <= 10) */ const LAZY_HEADER = 0x0b; const TRUE_HEADER = 0x0c; const FALSE_HEADER = 0x0d; const BOOLEANS_HEADER = 0x0e; const NULL_HEADER = 0x10; const NULL2_HEADER = 0x11; const NULL3_HEADER = 0x12; const NULLS8_HEADER = 0x13; const NULLS32_HEADER = 0x14; const NULL_AND_I8_HEADER = 0x15; const NULL_AND_I32_HEADER = 0x16; const NULL_AND_TRUE_HEADER = 0x17; const NULL_AND_FALSE_HEADER = 0x18; const STRING_HEADER = 0x1e; const BUFFER_HEADER = 0x1f; const I8_HEADER = 0x60; const I32_HEADER = 0x40; const F64_HEADER = 0x20; const SHORT_STRING_HEADER = 0x80; /** Uplift high-order bits */ const NUMBERS_HEADER_MASK = 0xe0; const NUMBERS_COUNT_MASK = 0x1f; // 0b0001_1111 const SHORT_STRING_LENGTH_MASK = 0x7f; // 0b0111_1111 const HEADER_SIZE = 1; const I8_SIZE = 1; const I32_SIZE = 4; const F64_SIZE = 8; const MEASURE_START_OPERATION = Symbol("MEASURE_START_OPERATION"); const MEASURE_END_OPERATION = Symbol("MEASURE_END_OPERATION"); /** @typedef {typeof MEASURE_START_OPERATION} MEASURE_START_OPERATION_TYPE */ /** @typedef {typeof MEASURE_END_OPERATION} MEASURE_END_OPERATION_TYPE */ const identifyNumber = n => { if (n === (n | 0)) { if (n <= 127 && n >= -128) return 0; if (n <= 2147483647 && n >= -2147483648) return 1; } return 2; }; /** * @typedef {PrimitiveSerializableType[]} DeserializedType * @typedef {BufferSerializableType[]} SerializedType * @extends {SerializerMiddleware} */ class BinaryMiddleware extends SerializerMiddleware { /** * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { return this._serialize(data, context); } _serializeLazy(fn, context) { return SerializerMiddleware.serializeLazy(fn, data => this._serialize(data, context) ); } /** * @param {DeserializedType} data data * @param {Object} context context object * @param {{ leftOverBuffer: Buffer | null, allocationSize: number, increaseCounter: number }} allocationScope allocation scope * @returns {SerializedType} serialized data */ _serialize( data, context, allocationScope = { allocationSize: 1024, increaseCounter: 0, leftOverBuffer: null } ) { /** @type {Buffer} */ let leftOverBuffer = null; /** @type {BufferSerializableType[]} */ let buffers = []; /** @type {Buffer} */ let currentBuffer = allocationScope ? allocationScope.leftOverBuffer : null; allocationScope.leftOverBuffer = null; let currentPosition = 0; if (currentBuffer === null) { currentBuffer = Buffer.allocUnsafe(allocationScope.allocationSize); } const allocate = bytesNeeded => { if (currentBuffer !== null) { if (currentBuffer.length - currentPosition >= bytesNeeded) return; flush(); } if (leftOverBuffer && leftOverBuffer.length >= bytesNeeded) { currentBuffer = leftOverBuffer; leftOverBuffer = null; } else { currentBuffer = Buffer.allocUnsafe( Math.max(bytesNeeded, allocationScope.allocationSize) ); if ( !(allocationScope.increaseCounter = (allocationScope.increaseCounter + 1) % 4) && allocationScope.allocationSize < 16777216 ) { allocationScope.allocationSize = allocationScope.allocationSize << 1; } } }; const flush = () => { if (currentBuffer !== null) { if (currentPosition > 0) { buffers.push( Buffer.from( currentBuffer.buffer, currentBuffer.byteOffset, currentPosition ) ); } if ( !leftOverBuffer || leftOverBuffer.length < currentBuffer.length - currentPosition ) { leftOverBuffer = Buffer.from( currentBuffer.buffer, currentBuffer.byteOffset + currentPosition, currentBuffer.byteLength - currentPosition ); } currentBuffer = null; currentPosition = 0; } }; const writeU8 = byte => { currentBuffer.writeUInt8(byte, currentPosition++); }; const writeU32 = ui32 => { currentBuffer.writeUInt32LE(ui32, currentPosition); currentPosition += 4; }; const measureStack = []; const measureStart = () => { measureStack.push(buffers.length, currentPosition); }; const measureEnd = () => { const oldPos = measureStack.pop(); const buffersIndex = measureStack.pop(); let size = currentPosition - oldPos; for (let i = buffersIndex; i < buffers.length; i++) { size += buffers[i].length; } return size; }; for (let i = 0; i < data.length; i++) { const thing = data[i]; switch (typeof thing) { case "function": { if (!SerializerMiddleware.isLazy(thing)) throw new Error("Unexpected function " + thing); /** @type {SerializedType | (() => SerializedType)} */ let serializedData = SerializerMiddleware.getLazySerializedValue(thing); if (serializedData === undefined) { if (SerializerMiddleware.isLazy(thing, this)) { flush(); allocationScope.leftOverBuffer = leftOverBuffer; const result = /** @type {(Exclude>)[]} */ ( thing() ); const data = this._serialize(result, context, allocationScope); leftOverBuffer = allocationScope.leftOverBuffer; allocationScope.leftOverBuffer = null; SerializerMiddleware.setLazySerializedValue(thing, data); serializedData = data; } else { serializedData = this._serializeLazy(thing, context); flush(); buffers.push(serializedData); break; } } else { if (typeof serializedData === "function") { flush(); buffers.push(serializedData); break; } } const lengths = []; for (const item of serializedData) { let last; if (typeof item === "function") { lengths.push(0); } else if (item.length === 0) { // ignore } else if ( lengths.length > 0 && (last = lengths[lengths.length - 1]) !== 0 ) { const remaining = 0xffffffff - last; if (remaining >= item.length) { lengths[lengths.length - 1] += item.length; } else { lengths.push(item.length - remaining); lengths[lengths.length - 2] = 0xffffffff; } } else { lengths.push(item.length); } } allocate(5 + lengths.length * 4); writeU8(LAZY_HEADER); writeU32(lengths.length); for (const l of lengths) { writeU32(l); } flush(); for (const item of serializedData) { buffers.push(item); } break; } case "string": { const len = Buffer.byteLength(thing); if (len >= 128 || len !== thing.length) { allocate(len + HEADER_SIZE + I32_SIZE); writeU8(STRING_HEADER); writeU32(len); currentBuffer.write(thing, currentPosition); currentPosition += len; } else if (len >= 70) { allocate(len + HEADER_SIZE); writeU8(SHORT_STRING_HEADER | len); currentBuffer.write(thing, currentPosition, "latin1"); currentPosition += len; } else { allocate(len + HEADER_SIZE); writeU8(SHORT_STRING_HEADER | len); for (let i = 0; i < len; i++) { currentBuffer[currentPosition++] = thing.charCodeAt(i); } } break; } case "number": { const type = identifyNumber(thing); if (type === 0 && thing >= 0 && thing <= 10) { // shortcut for very small numbers allocate(I8_SIZE); writeU8(thing); break; } /** * amount of numbers to write * @type {number} */ let n = 1; for (; n < 32 && i + n < data.length; n++) { const item = data[i + n]; if (typeof item !== "number") break; if (identifyNumber(item) !== type) break; } switch (type) { case 0: allocate(HEADER_SIZE + I8_SIZE * n); writeU8(I8_HEADER | (n - 1)); while (n > 0) { currentBuffer.writeInt8( /** @type {number} */ (data[i]), currentPosition ); currentPosition += I8_SIZE; n--; i++; } break; case 1: allocate(HEADER_SIZE + I32_SIZE * n); writeU8(I32_HEADER | (n - 1)); while (n > 0) { currentBuffer.writeInt32LE( /** @type {number} */ (data[i]), currentPosition ); currentPosition += I32_SIZE; n--; i++; } break; case 2: allocate(HEADER_SIZE + F64_SIZE * n); writeU8(F64_HEADER | (n - 1)); while (n > 0) { currentBuffer.writeDoubleLE( /** @type {number} */ (data[i]), currentPosition ); currentPosition += F64_SIZE; n--; i++; } break; } i--; break; } case "boolean": { let lastByte = thing === true ? 1 : 0; const bytes = []; let count = 1; let n; for (n = 1; n < 0xffffffff && i + n < data.length; n++) { const item = data[i + n]; if (typeof item !== "boolean") break; const pos = count & 0x7; if (pos === 0) { bytes.push(lastByte); lastByte = item === true ? 1 : 0; } else if (item === true) { lastByte |= 1 << pos; } count++; } i += count - 1; if (count === 1) { allocate(HEADER_SIZE); writeU8(lastByte === 1 ? TRUE_HEADER : FALSE_HEADER); } else if (count === 2) { allocate(HEADER_SIZE * 2); writeU8(lastByte & 1 ? TRUE_HEADER : FALSE_HEADER); writeU8(lastByte & 2 ? TRUE_HEADER : FALSE_HEADER); } else if (count <= 6) { allocate(HEADER_SIZE + I8_SIZE); writeU8(BOOLEANS_HEADER); writeU8((1 << count) | lastByte); } else if (count <= 133) { allocate(HEADER_SIZE + I8_SIZE + I8_SIZE * bytes.length + I8_SIZE); writeU8(BOOLEANS_HEADER); writeU8(0x80 | (count - 7)); for (const byte of bytes) writeU8(byte); writeU8(lastByte); } else { allocate( HEADER_SIZE + I8_SIZE + I32_SIZE + I8_SIZE * bytes.length + I8_SIZE ); writeU8(BOOLEANS_HEADER); writeU8(0xff); writeU32(count); for (const byte of bytes) writeU8(byte); writeU8(lastByte); } break; } case "object": { if (thing === null) { let n; for (n = 1; n < 0x100000104 && i + n < data.length; n++) { const item = data[i + n]; if (item !== null) break; } i += n - 1; if (n === 1) { if (i + 1 < data.length) { const next = data[i + 1]; if (next === true) { allocate(HEADER_SIZE); writeU8(NULL_AND_TRUE_HEADER); i++; } else if (next === false) { allocate(HEADER_SIZE); writeU8(NULL_AND_FALSE_HEADER); i++; } else if (typeof next === "number") { const type = identifyNumber(next); if (type === 0) { allocate(HEADER_SIZE + I8_SIZE); writeU8(NULL_AND_I8_HEADER); currentBuffer.writeInt8(next, currentPosition); currentPosition += I8_SIZE; i++; } else if (type === 1) { allocate(HEADER_SIZE + I32_SIZE); writeU8(NULL_AND_I32_HEADER); currentBuffer.writeInt32LE(next, currentPosition); currentPosition += I32_SIZE; i++; } else { allocate(HEADER_SIZE); writeU8(NULL_HEADER); } } else { allocate(HEADER_SIZE); writeU8(NULL_HEADER); } } else { allocate(HEADER_SIZE); writeU8(NULL_HEADER); } } else if (n === 2) { allocate(HEADER_SIZE); writeU8(NULL2_HEADER); } else if (n === 3) { allocate(HEADER_SIZE); writeU8(NULL3_HEADER); } else if (n < 260) { allocate(HEADER_SIZE + I8_SIZE); writeU8(NULLS8_HEADER); writeU8(n - 4); } else { allocate(HEADER_SIZE + I32_SIZE); writeU8(NULLS32_HEADER); writeU32(n - 260); } } else if (Buffer.isBuffer(thing)) { if (thing.length < 8192) { allocate(HEADER_SIZE + I32_SIZE + thing.length); writeU8(BUFFER_HEADER); writeU32(thing.length); thing.copy(currentBuffer, currentPosition); currentPosition += thing.length; } else { allocate(HEADER_SIZE + I32_SIZE); writeU8(BUFFER_HEADER); writeU32(thing.length); flush(); buffers.push(thing); } } break; } case "symbol": { if (thing === MEASURE_START_OPERATION) { measureStart(); } else if (thing === MEASURE_END_OPERATION) { const size = measureEnd(); allocate(HEADER_SIZE + I32_SIZE); writeU8(I32_HEADER); currentBuffer.writeInt32LE(size, currentPosition); currentPosition += I32_SIZE; } break; } } } flush(); allocationScope.leftOverBuffer = leftOverBuffer; // avoid leaking memory currentBuffer = null; leftOverBuffer = null; allocationScope = undefined; const _buffers = buffers; buffers = undefined; return _buffers; } /** * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { return this._deserialize(data, context); } _createLazyDeserialized(content, context) { return SerializerMiddleware.createLazy( memoize(() => this._deserialize(content, context)), this, undefined, content ); } _deserializeLazy(fn, context) { return SerializerMiddleware.deserializeLazy(fn, data => this._deserialize(data, context) ); } /** * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType} deserialized data */ _deserialize(data, context) { let currentDataItem = 0; let currentBuffer = data[0]; let currentIsBuffer = Buffer.isBuffer(currentBuffer); let currentPosition = 0; const retainedBuffer = context.retainedBuffer || (x => x); const checkOverflow = () => { if (currentPosition >= currentBuffer.length) { currentPosition = 0; currentDataItem++; currentBuffer = currentDataItem < data.length ? data[currentDataItem] : null; currentIsBuffer = Buffer.isBuffer(currentBuffer); } }; const isInCurrentBuffer = n => { return currentIsBuffer && n + currentPosition <= currentBuffer.length; }; const ensureBuffer = () => { if (!currentIsBuffer) { throw new Error( currentBuffer === null ? "Unexpected end of stream" : "Unexpected lazy element in stream" ); } }; /** * Reads n bytes * @param {number} n amount of bytes to read * @returns {Buffer} buffer with bytes */ const read = n => { ensureBuffer(); const rem = currentBuffer.length - currentPosition; if (rem < n) { const buffers = [read(rem)]; n -= rem; ensureBuffer(); while (currentBuffer.length < n) { const b = /** @type {Buffer} */ (currentBuffer); buffers.push(b); n -= b.length; currentDataItem++; currentBuffer = currentDataItem < data.length ? data[currentDataItem] : null; currentIsBuffer = Buffer.isBuffer(currentBuffer); ensureBuffer(); } buffers.push(read(n)); return Buffer.concat(buffers); } const b = /** @type {Buffer} */ (currentBuffer); const res = Buffer.from(b.buffer, b.byteOffset + currentPosition, n); currentPosition += n; checkOverflow(); return res; }; /** * Reads up to n bytes * @param {number} n amount of bytes to read * @returns {Buffer} buffer with bytes */ const readUpTo = n => { ensureBuffer(); const rem = currentBuffer.length - currentPosition; if (rem < n) { n = rem; } const b = /** @type {Buffer} */ (currentBuffer); const res = Buffer.from(b.buffer, b.byteOffset + currentPosition, n); currentPosition += n; checkOverflow(); return res; }; const readU8 = () => { ensureBuffer(); /** * There is no need to check remaining buffer size here * since {@link checkOverflow} guarantees at least one byte remaining */ const byte = /** @type {Buffer} */ (currentBuffer).readUInt8( currentPosition ); currentPosition += I8_SIZE; checkOverflow(); return byte; }; const readU32 = () => { return read(I32_SIZE).readUInt32LE(0); }; const readBits = (data, n) => { let mask = 1; while (n !== 0) { result.push((data & mask) !== 0); mask = mask << 1; n--; } }; const dispatchTable = Array.from({ length: 256 }).map((_, header) => { switch (header) { case LAZY_HEADER: return () => { const count = readU32(); const lengths = Array.from({ length: count }).map(() => readU32()); const content = []; for (let l of lengths) { if (l === 0) { if (typeof currentBuffer !== "function") { throw new Error("Unexpected non-lazy element in stream"); } content.push(currentBuffer); currentDataItem++; currentBuffer = currentDataItem < data.length ? data[currentDataItem] : null; currentIsBuffer = Buffer.isBuffer(currentBuffer); } else { do { const buf = readUpTo(l); l -= buf.length; content.push(retainedBuffer(buf)); } while (l > 0); } } result.push(this._createLazyDeserialized(content, context)); }; case BUFFER_HEADER: return () => { const len = readU32(); result.push(retainedBuffer(read(len))); }; case TRUE_HEADER: return () => result.push(true); case FALSE_HEADER: return () => result.push(false); case NULL3_HEADER: return () => result.push(null, null, null); case NULL2_HEADER: return () => result.push(null, null); case NULL_HEADER: return () => result.push(null); case NULL_AND_TRUE_HEADER: return () => result.push(null, true); case NULL_AND_FALSE_HEADER: return () => result.push(null, false); case NULL_AND_I8_HEADER: return () => { if (currentIsBuffer) { result.push( null, /** @type {Buffer} */ (currentBuffer).readInt8(currentPosition) ); currentPosition += I8_SIZE; checkOverflow(); } else { result.push(null, read(I8_SIZE).readInt8(0)); } }; case NULL_AND_I32_HEADER: return () => { result.push(null); if (isInCurrentBuffer(I32_SIZE)) { result.push( /** @type {Buffer} */ (currentBuffer).readInt32LE( currentPosition ) ); currentPosition += I32_SIZE; checkOverflow(); } else { result.push(read(I32_SIZE).readInt32LE(0)); } }; case NULLS8_HEADER: return () => { const len = readU8() + 4; for (let i = 0; i < len; i++) { result.push(null); } }; case NULLS32_HEADER: return () => { const len = readU32() + 260; for (let i = 0; i < len; i++) { result.push(null); } }; case BOOLEANS_HEADER: return () => { const innerHeader = readU8(); if ((innerHeader & 0xf0) === 0) { readBits(innerHeader, 3); } else if ((innerHeader & 0xe0) === 0) { readBits(innerHeader, 4); } else if ((innerHeader & 0xc0) === 0) { readBits(innerHeader, 5); } else if ((innerHeader & 0x80) === 0) { readBits(innerHeader, 6); } else if (innerHeader !== 0xff) { let count = (innerHeader & 0x7f) + 7; while (count > 8) { readBits(readU8(), 8); count -= 8; } readBits(readU8(), count); } else { let count = readU32(); while (count > 8) { readBits(readU8(), 8); count -= 8; } readBits(readU8(), count); } }; case STRING_HEADER: return () => { const len = readU32(); if (isInCurrentBuffer(len) && currentPosition + len < 0x7fffffff) { result.push( currentBuffer.toString( undefined, currentPosition, currentPosition + len ) ); currentPosition += len; checkOverflow(); } else { result.push(read(len).toString()); } }; case SHORT_STRING_HEADER: return () => result.push(""); case SHORT_STRING_HEADER | 1: return () => { if (currentIsBuffer && currentPosition < 0x7ffffffe) { result.push( currentBuffer.toString( "latin1", currentPosition, currentPosition + 1 ) ); currentPosition++; checkOverflow(); } else { result.push(read(1).toString("latin1")); } }; case I8_HEADER: return () => { if (currentIsBuffer) { result.push( /** @type {Buffer} */ (currentBuffer).readInt8(currentPosition) ); currentPosition++; checkOverflow(); } else { result.push(read(1).readInt8(0)); } }; default: if (header <= 10) { return () => result.push(header); } else if ((header & SHORT_STRING_HEADER) === SHORT_STRING_HEADER) { const len = header & SHORT_STRING_LENGTH_MASK; return () => { if ( isInCurrentBuffer(len) && currentPosition + len < 0x7fffffff ) { result.push( currentBuffer.toString( "latin1", currentPosition, currentPosition + len ) ); currentPosition += len; checkOverflow(); } else { result.push(read(len).toString("latin1")); } }; } else if ((header & NUMBERS_HEADER_MASK) === F64_HEADER) { const len = (header & NUMBERS_COUNT_MASK) + 1; return () => { const need = F64_SIZE * len; if (isInCurrentBuffer(need)) { for (let i = 0; i < len; i++) { result.push( /** @type {Buffer} */ (currentBuffer).readDoubleLE( currentPosition ) ); currentPosition += F64_SIZE; } checkOverflow(); } else { const buf = read(need); for (let i = 0; i < len; i++) { result.push(buf.readDoubleLE(i * F64_SIZE)); } } }; } else if ((header & NUMBERS_HEADER_MASK) === I32_HEADER) { const len = (header & NUMBERS_COUNT_MASK) + 1; return () => { const need = I32_SIZE * len; if (isInCurrentBuffer(need)) { for (let i = 0; i < len; i++) { result.push( /** @type {Buffer} */ (currentBuffer).readInt32LE( currentPosition ) ); currentPosition += I32_SIZE; } checkOverflow(); } else { const buf = read(need); for (let i = 0; i < len; i++) { result.push(buf.readInt32LE(i * I32_SIZE)); } } }; } else if ((header & NUMBERS_HEADER_MASK) === I8_HEADER) { const len = (header & NUMBERS_COUNT_MASK) + 1; return () => { const need = I8_SIZE * len; if (isInCurrentBuffer(need)) { for (let i = 0; i < len; i++) { result.push( /** @type {Buffer} */ (currentBuffer).readInt8( currentPosition ) ); currentPosition += I8_SIZE; } checkOverflow(); } else { const buf = read(need); for (let i = 0; i < len; i++) { result.push(buf.readInt8(i * I8_SIZE)); } } }; } else { return () => { throw new Error( `Unexpected header byte 0x${header.toString(16)}` ); }; } } }); /** @type {DeserializedType} */ let result = []; while (currentBuffer !== null) { if (typeof currentBuffer === "function") { result.push(this._deserializeLazy(currentBuffer, context)); currentDataItem++; currentBuffer = currentDataItem < data.length ? data[currentDataItem] : null; currentIsBuffer = Buffer.isBuffer(currentBuffer); } else { const header = readU8(); dispatchTable[header](); } } // avoid leaking memory in context let _result = result; result = undefined; return _result; } } module.exports = BinaryMiddleware; module.exports.MEASURE_START_OPERATION = MEASURE_START_OPERATION; module.exports.MEASURE_END_OPERATION = MEASURE_END_OPERATION; /***/ }), /***/ 32973: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class DateObjectSerializer { serialize(obj, { write }) { write(obj.getTime()); } deserialize({ read }) { return new Date(read()); } } module.exports = DateObjectSerializer; /***/ }), /***/ 60252: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class ErrorObjectSerializer { constructor(Type) { this.Type = Type; } serialize(obj, { write }) { write(obj.message); write(obj.stack); } deserialize({ read }) { const err = new this.Type(); err.message = read(); err.stack = read(); return err; } } module.exports = ErrorObjectSerializer; /***/ }), /***/ 40572: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const { constants } = __webpack_require__(64293); const { pipeline } = __webpack_require__(92413); const { createBrotliCompress, createBrotliDecompress, createGzip, createGunzip, constants: zConstants } = __webpack_require__(78761); const createHash = __webpack_require__(24123); const { dirname, join, mkdirp } = __webpack_require__(93204); const memoize = __webpack_require__(84297); const SerializerMiddleware = __webpack_require__(37063); /** @typedef {typeof import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */ /** @typedef {import("./types").BufferSerializableType} BufferSerializableType */ /* Format: File -> Header Section* Version -> u32 AmountOfSections -> u32 SectionSize -> i32 (if less than zero represents lazy value) Header -> Version AmountOfSections SectionSize* Buffer -> n bytes Section -> Buffer */ // "wpc" + 1 in little-endian const VERSION = 0x01637077; /** * @param {Buffer[]} buffers buffers * @param {string | Hash} hashFunction hash function to use * @returns {string} hash */ const hashForName = (buffers, hashFunction) => { const hash = createHash(hashFunction); for (const buf of buffers) hash.update(buf); return /** @type {string} */ (hash.digest("hex")); }; const COMPRESSION_CHUNK_SIZE = 100 * 1024 * 1024; const DECOMPRESSION_CHUNK_SIZE = 100 * 1024 * 1024; const writeUInt64LE = Buffer.prototype.writeBigUInt64LE ? (buf, value, offset) => { buf.writeBigUInt64LE(BigInt(value), offset); } : (buf, value, offset) => { const low = value % 0x100000000; const high = (value - low) / 0x100000000; buf.writeUInt32LE(low, offset); buf.writeUInt32LE(high, offset + 4); }; const readUInt64LE = Buffer.prototype.readBigUInt64LE ? (buf, offset) => { return Number(buf.readBigUInt64LE(offset)); } : (buf, offset) => { const low = buf.readUInt32LE(offset); const high = buf.readUInt32LE(offset + 4); return high * 0x100000000 + low; }; /** * @typedef {Object} SerializeResult * @property {string | false} name * @property {number} size * @property {Promise=} backgroundJob */ /** * @param {FileMiddleware} middleware this * @param {BufferSerializableType[] | Promise} data data to be serialized * @param {string | boolean} name file base name * @param {function(string | false, Buffer[]): Promise} writeFile writes a file * @param {string | Hash} hashFunction hash function to use * @returns {Promise} resulting file pointer and promise */ const serialize = async ( middleware, data, name, writeFile, hashFunction = "md4" ) => { /** @type {(Buffer[] | Buffer | SerializeResult | Promise)[]} */ const processedData = []; /** @type {WeakMap>} */ const resultToLazy = new WeakMap(); /** @type {Buffer[]} */ let lastBuffers = undefined; for (const item of await data) { if (typeof item === "function") { if (!SerializerMiddleware.isLazy(item)) throw new Error("Unexpected function"); if (!SerializerMiddleware.isLazy(item, middleware)) { throw new Error( "Unexpected lazy value with non-this target (can't pass through lazy values)" ); } lastBuffers = undefined; const serializedInfo = SerializerMiddleware.getLazySerializedValue(item); if (serializedInfo) { if (typeof serializedInfo === "function") { throw new Error( "Unexpected lazy value with non-this target (can't pass through lazy values)" ); } else { processedData.push(serializedInfo); } } else { const content = item(); if (content) { const options = SerializerMiddleware.getLazyOptions(item); processedData.push( serialize( middleware, content, (options && options.name) || true, writeFile, hashFunction ).then(result => { /** @type {any} */ (item).options.size = result.size; resultToLazy.set(result, item); return result; }) ); } else { throw new Error( "Unexpected falsy value returned by lazy value function" ); } } } else if (item) { if (lastBuffers) { lastBuffers.push(item); } else { lastBuffers = [item]; processedData.push(lastBuffers); } } else { throw new Error("Unexpected falsy value in items array"); } } /** @type {Promise[]} */ const backgroundJobs = []; const resolvedData = ( await Promise.all( /** @type {Promise[]} */ ( processedData ) ) ).map(item => { if (Array.isArray(item) || Buffer.isBuffer(item)) return item; backgroundJobs.push(item.backgroundJob); // create pointer buffer from size and name const name = /** @type {string} */ (item.name); const nameBuffer = Buffer.from(name); const buf = Buffer.allocUnsafe(8 + nameBuffer.length); writeUInt64LE(buf, item.size, 0); nameBuffer.copy(buf, 8, 0); const lazy = resultToLazy.get(item); SerializerMiddleware.setLazySerializedValue(lazy, buf); return buf; }); const lengths = []; for (const item of resolvedData) { if (Array.isArray(item)) { let l = 0; for (const b of item) l += b.length; while (l > 0x7fffffff) { lengths.push(0x7fffffff); l -= 0x7fffffff; } lengths.push(l); } else if (item) { lengths.push(-item.length); } else { throw new Error("Unexpected falsy value in resolved data " + item); } } const header = Buffer.allocUnsafe(8 + lengths.length * 4); header.writeUInt32LE(VERSION, 0); header.writeUInt32LE(lengths.length, 4); for (let i = 0; i < lengths.length; i++) { header.writeInt32LE(lengths[i], 8 + i * 4); } const buf = [header]; for (const item of resolvedData) { if (Array.isArray(item)) { for (const b of item) buf.push(b); } else if (item) { buf.push(item); } } if (name === true) { name = hashForName(buf, hashFunction); } backgroundJobs.push(writeFile(name, buf)); let size = 0; for (const b of buf) size += b.length; return { size, name, backgroundJob: backgroundJobs.length === 1 ? backgroundJobs[0] : Promise.all(backgroundJobs) }; }; /** * @param {FileMiddleware} middleware this * @param {string | false} name filename * @param {function(string | false): Promise} readFile read content of a file * @returns {Promise} deserialized data */ const deserialize = async (middleware, name, readFile) => { const contents = await readFile(name); if (contents.length === 0) throw new Error("Empty file " + name); let contentsIndex = 0; let contentItem = contents[0]; let contentItemLength = contentItem.length; let contentPosition = 0; if (contentItemLength === 0) throw new Error("Empty file " + name); const nextContent = () => { contentsIndex++; contentItem = contents[contentsIndex]; contentItemLength = contentItem.length; contentPosition = 0; }; const ensureData = n => { if (contentPosition === contentItemLength) { nextContent(); } while (contentItemLength - contentPosition < n) { const remaining = contentItem.slice(contentPosition); let lengthFromNext = n - remaining.length; const buffers = [remaining]; for (let i = contentsIndex + 1; i < contents.length; i++) { const l = contents[i].length; if (l > lengthFromNext) { buffers.push(contents[i].slice(0, lengthFromNext)); contents[i] = contents[i].slice(lengthFromNext); lengthFromNext = 0; break; } else { buffers.push(contents[i]); contentsIndex = i; lengthFromNext -= l; } } if (lengthFromNext > 0) throw new Error("Unexpected end of data"); contentItem = Buffer.concat(buffers, n); contentItemLength = n; contentPosition = 0; } }; const readUInt32LE = () => { ensureData(4); const value = contentItem.readUInt32LE(contentPosition); contentPosition += 4; return value; }; const readInt32LE = () => { ensureData(4); const value = contentItem.readInt32LE(contentPosition); contentPosition += 4; return value; }; const readSlice = l => { ensureData(l); if (contentPosition === 0 && contentItemLength === l) { const result = contentItem; if (contentsIndex + 1 < contents.length) { nextContent(); } else { contentPosition = l; } return result; } const result = contentItem.slice(contentPosition, contentPosition + l); contentPosition += l; // we clone the buffer here to allow the original content to be garbage collected return l * 2 < contentItem.buffer.byteLength ? Buffer.from(result) : result; }; const version = readUInt32LE(); if (version !== VERSION) { throw new Error("Invalid file version"); } const sectionCount = readUInt32LE(); const lengths = []; let lastLengthPositive = false; for (let i = 0; i < sectionCount; i++) { const value = readInt32LE(); const valuePositive = value >= 0; if (lastLengthPositive && valuePositive) { lengths[lengths.length - 1] += value; } else { lengths.push(value); lastLengthPositive = valuePositive; } } const result = []; for (let length of lengths) { if (length < 0) { const slice = readSlice(-length); const size = Number(readUInt64LE(slice, 0)); const nameBuffer = slice.slice(8); const name = nameBuffer.toString(); result.push( SerializerMiddleware.createLazy( memoize(() => deserialize(middleware, name, readFile)), middleware, { name, size }, slice ) ); } else { if (contentPosition === contentItemLength) { nextContent(); } else if (contentPosition !== 0) { if (length <= contentItemLength - contentPosition) { result.push( Buffer.from( contentItem.buffer, contentItem.byteOffset + contentPosition, length ) ); contentPosition += length; length = 0; } else { const l = contentItemLength - contentPosition; result.push( Buffer.from( contentItem.buffer, contentItem.byteOffset + contentPosition, l ) ); length -= l; contentPosition = contentItemLength; } } else { if (length >= contentItemLength) { result.push(contentItem); length -= contentItemLength; contentPosition = contentItemLength; } else { result.push( Buffer.from(contentItem.buffer, contentItem.byteOffset, length) ); contentPosition += length; length = 0; } } while (length > 0) { nextContent(); if (length >= contentItemLength) { result.push(contentItem); length -= contentItemLength; contentPosition = contentItemLength; } else { result.push( Buffer.from(contentItem.buffer, contentItem.byteOffset, length) ); contentPosition += length; length = 0; } } } } return result; }; /** * @typedef {BufferSerializableType[]} DeserializedType * @typedef {true} SerializedType * @extends {SerializerMiddleware} */ class FileMiddleware extends SerializerMiddleware { /** * @param {IntermediateFileSystem} fs filesystem * @param {string | Hash} hashFunction hash function to use */ constructor(fs, hashFunction = "md4") { super(); this.fs = fs; this._hashFunction = hashFunction; } /** * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { const { filename, extension = "" } = context; return new Promise((resolve, reject) => { mkdirp(this.fs, dirname(this.fs, filename), err => { if (err) return reject(err); // It's important that we don't touch existing files during serialization // because serialize may read existing files (when deserializing) const allWrittenFiles = new Set(); const writeFile = async (name, content) => { const file = name ? join(this.fs, filename, `../${name}${extension}`) : filename; await new Promise((resolve, reject) => { let stream = this.fs.createWriteStream(file + "_"); let compression; if (file.endsWith(".gz")) { compression = createGzip({ chunkSize: COMPRESSION_CHUNK_SIZE, level: zConstants.Z_BEST_SPEED }); } else if (file.endsWith(".br")) { compression = createBrotliCompress({ chunkSize: COMPRESSION_CHUNK_SIZE, params: { [zConstants.BROTLI_PARAM_MODE]: zConstants.BROTLI_MODE_TEXT, [zConstants.BROTLI_PARAM_QUALITY]: 2, [zConstants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: true, [zConstants.BROTLI_PARAM_SIZE_HINT]: content.reduce( (size, b) => size + b.length, 0 ) } }); } if (compression) { pipeline(compression, stream, reject); stream = compression; stream.on("finish", () => resolve()); } else { stream.on("error", err => reject(err)); stream.on("finish", () => resolve()); } for (const b of content) stream.write(b); stream.end(); }); if (name) allWrittenFiles.add(file); }; resolve( serialize(this, data, false, writeFile, this._hashFunction).then( async ({ backgroundJob }) => { await backgroundJob; // Rename the index file to disallow access during inconsistent file state await new Promise(resolve => this.fs.rename(filename, filename + ".old", err => { resolve(); }) ); // update all written files await Promise.all( Array.from( allWrittenFiles, file => new Promise((resolve, reject) => { this.fs.rename(file + "_", file, err => { if (err) return reject(err); resolve(); }); }) ) ); // As final step automatically update the index file to have a consistent pack again await new Promise(resolve => { this.fs.rename(filename + "_", filename, err => { if (err) return reject(err); resolve(); }); }); return /** @type {true} */ (true); } ) ); }); }); } /** * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { const { filename, extension = "" } = context; const readFile = name => new Promise((resolve, reject) => { const file = name ? join(this.fs, filename, `../${name}${extension}`) : filename; this.fs.stat(file, (err, stats) => { if (err) { reject(err); return; } let remaining = /** @type {number} */ (stats.size); let currentBuffer; let currentBufferUsed; const buf = []; let decompression; if (file.endsWith(".gz")) { decompression = createGunzip({ chunkSize: DECOMPRESSION_CHUNK_SIZE }); } else if (file.endsWith(".br")) { decompression = createBrotliDecompress({ chunkSize: DECOMPRESSION_CHUNK_SIZE }); } if (decompression) { let newResolve, newReject; resolve( Promise.all([ new Promise((rs, rj) => { newResolve = rs; newReject = rj; }), new Promise((resolve, reject) => { decompression.on("data", chunk => buf.push(chunk)); decompression.on("end", () => resolve()); decompression.on("error", err => reject(err)); }) ]).then(() => buf) ); resolve = newResolve; reject = newReject; } this.fs.open(file, "r", (err, fd) => { if (err) { reject(err); return; } const read = () => { if (currentBuffer === undefined) { currentBuffer = Buffer.allocUnsafeSlow( Math.min( constants.MAX_LENGTH, remaining, decompression ? DECOMPRESSION_CHUNK_SIZE : Infinity ) ); currentBufferUsed = 0; } let readBuffer = currentBuffer; let readOffset = currentBufferUsed; let readLength = currentBuffer.length - currentBufferUsed; // values passed to fs.read must be valid int32 values if (readOffset > 0x7fffffff) { readBuffer = currentBuffer.slice(readOffset); readOffset = 0; } if (readLength > 0x7fffffff) { readLength = 0x7fffffff; } this.fs.read( fd, readBuffer, readOffset, readLength, null, (err, bytesRead) => { if (err) { this.fs.close(fd, () => { reject(err); }); return; } currentBufferUsed += bytesRead; remaining -= bytesRead; if (currentBufferUsed === currentBuffer.length) { if (decompression) { decompression.write(currentBuffer); } else { buf.push(currentBuffer); } currentBuffer = undefined; if (remaining === 0) { if (decompression) { decompression.end(); } this.fs.close(fd, err => { if (err) { reject(err); return; } resolve(buf); }); return; } } read(); } ); }; read(); }); }); }); return deserialize(this, false, readFile); } } module.exports = FileMiddleware; /***/ }), /***/ 82547: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class MapObjectSerializer { serialize(obj, { write }) { write(obj.size); for (const key of obj.keys()) { write(key); } for (const value of obj.values()) { write(value); } } deserialize({ read }) { let size = read(); const map = new Map(); const keys = []; for (let i = 0; i < size; i++) { keys.push(read()); } for (let i = 0; i < size; i++) { map.set(keys[i], read()); } return map; } } module.exports = MapObjectSerializer; /***/ }), /***/ 52985: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class NullPrototypeObjectSerializer { serialize(obj, { write }) { const keys = Object.keys(obj); for (const key of keys) { write(key); } write(null); for (const key of keys) { write(obj[key]); } } deserialize({ read }) { const obj = Object.create(null); const keys = []; let key = read(); while (key !== null) { keys.push(key); key = read(); } for (const key of keys) { obj[key] = read(); } return obj; } } module.exports = NullPrototypeObjectSerializer; /***/ }), /***/ 77815: /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const createHash = __webpack_require__(24123); const ArraySerializer = __webpack_require__(80573); const DateObjectSerializer = __webpack_require__(32973); const ErrorObjectSerializer = __webpack_require__(60252); const MapObjectSerializer = __webpack_require__(82547); const NullPrototypeObjectSerializer = __webpack_require__(52985); const PlainObjectSerializer = __webpack_require__(24298); const RegExpObjectSerializer = __webpack_require__(90410); const SerializerMiddleware = __webpack_require__(37063); const SetObjectSerializer = __webpack_require__(85199); /** @typedef {typeof import("../util/Hash")} Hash */ /** @typedef {import("./types").ComplexSerializableType} ComplexSerializableType */ /** @typedef {import("./types").PrimitiveSerializableType} PrimitiveSerializableType */ /** @typedef {new (...params: any[]) => any} Constructor */ /* Format: File -> Section* Section -> ObjectSection | ReferenceSection | EscapeSection | OtherSection ObjectSection -> ESCAPE ( number:relativeOffset (number > 0) | string:request (string|null):export ) Section:value* ESCAPE ESCAPE_END_OBJECT ReferenceSection -> ESCAPE number:relativeOffset (number < 0) EscapeSection -> ESCAPE ESCAPE_ESCAPE_VALUE (escaped value ESCAPE) EscapeSection -> ESCAPE ESCAPE_UNDEFINED (escaped value ESCAPE) OtherSection -> any (except ESCAPE) Why using null as escape value? Multiple null values can merged by the BinaryMiddleware, which makes it very efficient Technically any value can be used. */ /** * @typedef {Object} ObjectSerializerContext * @property {function(any): void} write */ /** * @typedef {Object} ObjectDeserializerContext * @property {function(): any} read */ /** * @typedef {Object} ObjectSerializer * @property {function(any, ObjectSerializerContext): void} serialize * @property {function(ObjectDeserializerContext): any} deserialize */ const setSetSize = (set, size) => { let i = 0; for (const item of set) { if (i++ >= size) { set.delete(item); } } }; const setMapSize = (map, size) => { let i = 0; for (const item of map.keys()) { if (i++ >= size) { map.delete(item); } } }; /** * @param {Buffer} buffer buffer * @param {string | Hash} hashFunction hash function to use * @returns {string} hash */ const toHash = (buffer, hashFunction) => { const hash = createHash(hashFunction); hash.update(buffer); return /** @type {string} */ (hash.digest("latin1")); }; const ESCAPE = null; const ESCAPE_ESCAPE_VALUE = null; const ESCAPE_END_OBJECT = true; const ESCAPE_UNDEFINED = false; const CURRENT_VERSION = 2; const serializers = new Map(); const serializerInversed = new Map(); const loadedRequests = new Set(); const NOT_SERIALIZABLE = {}; const jsTypes = new Map(); jsTypes.set(Object, new PlainObjectSerializer()); jsTypes.set(Array, new ArraySerializer()); jsTypes.set(null, new NullPrototypeObjectSerializer()); jsTypes.set(Map, new MapObjectSerializer()); jsTypes.set(Set, new SetObjectSerializer()); jsTypes.set(Date, new DateObjectSerializer()); jsTypes.set(RegExp, new RegExpObjectSerializer()); jsTypes.set(Error, new ErrorObjectSerializer(Error)); jsTypes.set(EvalError, new ErrorObjectSerializer(EvalError)); jsTypes.set(RangeError, new ErrorObjectSerializer(RangeError)); jsTypes.set(ReferenceError, new ErrorObjectSerializer(ReferenceError)); jsTypes.set(SyntaxError, new ErrorObjectSerializer(SyntaxError)); jsTypes.set(TypeError, new ErrorObjectSerializer(TypeError)); // If in a sandboxed environment (e. g. jest), this escapes the sandbox and registers // real Object and Array types to. These types may occur in the wild too, e. g. when // using Structured Clone in postMessage. if (exports.constructor !== Object) { const Obj = /** @type {typeof Object} */ (exports.constructor); const Fn = /** @type {typeof Function} */ (Obj.constructor); for (const [type, config] of Array.from(jsTypes)) { if (type) { const Type = new Fn(`return ${type.name};`)(); jsTypes.set(Type, config); } } } { let i = 1; for (const [type, serializer] of jsTypes) { serializers.set(type, { request: "", name: i++, serializer }); } } for (const { request, name, serializer } of serializers.values()) { serializerInversed.set(`${request}/${name}`, serializer); } /** @type {Map boolean>} */ const loaders = new Map(); /** * @typedef {ComplexSerializableType[]} DeserializedType * @typedef {PrimitiveSerializableType[]} SerializedType * @extends {SerializerMiddleware} */ class ObjectMiddleware extends SerializerMiddleware { /** * @param {function(any): void} extendContext context extensions * @param {string | Hash} hashFunction hash function to use */ constructor(extendContext, hashFunction = "md4") { super(); this.extendContext = extendContext; this._hashFunction = hashFunction; } /** * @param {RegExp} regExp RegExp for which the request is tested * @param {function(string): boolean} loader loader to load the request, returns true when successful * @returns {void} */ static registerLoader(regExp, loader) { loaders.set(regExp, loader); } /** * @param {Constructor} Constructor the constructor * @param {string} request the request which will be required when deserializing * @param {string} name the name to make multiple serializer unique when sharing a request * @param {ObjectSerializer} serializer the serializer * @returns {void} */ static register(Constructor, request, name, serializer) { const key = request + "/" + name; if (serializers.has(Constructor)) { throw new Error( `ObjectMiddleware.register: serializer for ${Constructor.name} is already registered` ); } if (serializerInversed.has(key)) { throw new Error( `ObjectMiddleware.register: serializer for ${key} is already registered` ); } serializers.set(Constructor, { request, name, serializer }); serializerInversed.set(key, serializer); } /** * @param {Constructor} Constructor the constructor * @returns {void} */ static registerNotSerializable(Constructor) { if (serializers.has(Constructor)) { throw new Error( `ObjectMiddleware.registerNotSerializable: serializer for ${Constructor.name} is already registered` ); } serializers.set(Constructor, NOT_SERIALIZABLE); } static getSerializerFor(object) { const proto = Object.getPrototypeOf(object); let c; if (proto === null) { // Object created with Object.create(null) c = null; } else { c = proto.constructor; if (!c) { throw new Error( "Serialization of objects with prototype without valid constructor property not possible" ); } } const config = serializers.get(c); if (!config) throw new Error(`No serializer registered for ${c.name}`); if (config === NOT_SERIALIZABLE) throw NOT_SERIALIZABLE; return config; } static getDeserializerFor(request, name) { const key = request + "/" + name; const serializer = serializerInversed.get(key); if (serializer === undefined) { throw new Error(`No deserializer registered for ${key}`); } return serializer; } static _getDeserializerForWithoutError(request, name) { const key = request + "/" + name; const serializer = serializerInversed.get(key); return serializer; } /** * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { /** @type {any[]} */ let result = [CURRENT_VERSION]; let currentPos = 0; let referenceable = new Map(); const addReferenceable = item => { referenceable.set(item, currentPos++); }; let bufferDedupeMap = new Map(); const dedupeBuffer = buf => { const len = buf.length; const entry = bufferDedupeMap.get(len); if (entry === undefined) { bufferDedupeMap.set(len, buf); return buf; } if (Buffer.isBuffer(entry)) { if (len < 32) { if (buf.equals(entry)) { return entry; } bufferDedupeMap.set(len, [entry, buf]); return buf; } else { const hash = toHash(entry, this._hashFunction); const newMap = new Map(); newMap.set(hash, entry); bufferDedupeMap.set(len, newMap); const hashBuf = toHash(buf, this._hashFunction); if (hash === hashBuf) { return entry; } return buf; } } else if (Array.isArray(entry)) { if (entry.length < 16) { for (const item of entry) { if (buf.equals(item)) { return item; } } entry.push(buf); return buf; } else { const newMap = new Map(); const hash = toHash(buf, this._hashFunction); let found; for (const item of entry) { const itemHash = toHash(item, this._hashFunction); newMap.set(itemHash, item); if (found === undefined && itemHash === hash) found = item; } bufferDedupeMap.set(len, newMap); if (found === undefined) { newMap.set(hash, buf); return buf; } else { return found; } } } else { const hash = toHash(buf, this._hashFunction); const item = entry.get(hash); if (item !== undefined) { return item; } entry.set(hash, buf); return buf; } }; let currentPosTypeLookup = 0; let objectTypeLookup = new Map(); const cycleStack = new Set(); const stackToString = item => { const arr = Array.from(cycleStack); arr.push(item); return arr .map(item => { if (typeof item === "string") { if (item.length > 100) { return `String ${JSON.stringify(item.slice(0, 100)).slice( 0, -1 )}..."`; } return `String ${JSON.stringify(item)}`; } try { const { request, name } = ObjectMiddleware.getSerializerFor(item); if (request) { return `${request}${name ? `.${name}` : ""}`; } } catch (e) { // ignore -> fallback } if (typeof item === "object" && item !== null) { if (item.constructor) { if (item.constructor === Object) return `Object { ${Object.keys(item).join(", ")} }`; if (item.constructor === Map) return `Map { ${item.size} items }`; if (item.constructor === Array) return `Array { ${item.length} items }`; if (item.constructor === Set) return `Set { ${item.size} items }`; if (item.constructor === RegExp) return item.toString(); return `${item.constructor.name}`; } return `Object [null prototype] { ${Object.keys(item).join( ", " )} }`; } try { return `${item}`; } catch (e) { return `(${e.message})`; } }) .join(" -> "); }; let hasDebugInfoAttached; let ctx = { write(value, key) { try { process(value); } catch (e) { if (e !== NOT_SERIALIZABLE) { if (hasDebugInfoAttached === undefined) hasDebugInfoAttached = new WeakSet(); if (!hasDebugInfoAttached.has(e)) { e.message += `\nwhile serializing ${stackToString(value)}`; hasDebugInfoAttached.add(e); } } throw e; } }, setCircularReference(ref) { addReferenceable(ref); }, snapshot() { return { length: result.length, cycleStackSize: cycleStack.size, referenceableSize: referenceable.size, currentPos, objectTypeLookupSize: objectTypeLookup.size, currentPosTypeLookup }; }, rollback(snapshot) { result.length = snapshot.length; setSetSize(cycleStack, snapshot.cycleStackSize); setMapSize(referenceable, snapshot.referenceableSize); currentPos = snapshot.currentPos; setMapSize(objectTypeLookup, snapshot.objectTypeLookupSize); currentPosTypeLookup = snapshot.currentPosTypeLookup; }, ...context }; this.extendContext(ctx); const process = item => { if (Buffer.isBuffer(item)) { // check if we can emit a reference const ref = referenceable.get(item); if (ref !== undefined) { result.push(ESCAPE, ref - currentPos); return; } const alreadyUsedBuffer = dedupeBuffer(item); if (alreadyUsedBuffer !== item) { const ref = referenceable.get(alreadyUsedBuffer); if (ref !== undefined) { referenceable.set(item, ref); result.push(ESCAPE, ref - currentPos); return; } item = alreadyUsedBuffer; } addReferenceable(item); result.push(item); } else if (item === ESCAPE) { result.push(ESCAPE, ESCAPE_ESCAPE_VALUE); } else if ( typeof item === "object" // We don't have to check for null as ESCAPE is null and this has been checked before ) { // check if we can emit a reference const ref = referenceable.get(item); if (ref !== undefined) { result.push(ESCAPE, ref - currentPos); return; } if (cycleStack.has(item)) { throw new Error( `This is a circular references. To serialize circular references use 'setCircularReference' somewhere in the circle during serialize and deserialize.` ); } const { request, name, serializer } = ObjectMiddleware.getSerializerFor(item); const key = `${request}/${name}`; const lastIndex = objectTypeLookup.get(key); if (lastIndex === undefined) { objectTypeLookup.set(key, currentPosTypeLookup++); result.push(ESCAPE, request, name); } else { result.push(ESCAPE, currentPosTypeLookup - lastIndex); } cycleStack.add(item); try { serializer.serialize(item, ctx); } finally { cycleStack.delete(item); } result.push(ESCAPE, ESCAPE_END_OBJECT); addReferenceable(item); } else if (typeof item === "string") { if (item.length > 1) { // short strings are shorter when not emitting a reference (this saves 1 byte per empty string) // check if we can emit a reference const ref = referenceable.get(item); if (ref !== undefined) { result.push(ESCAPE, ref - currentPos); return; } addReferenceable(item); } if (item.length > 102400 && context.logger) { context.logger.warn( `Serializing big strings (${Math.round( item.length / 1024 )}kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)` ); } result.push(item); } else if (typeof item === "function") { if (!SerializerMiddleware.isLazy(item)) throw new Error("Unexpected function " + item); /** @type {SerializedType} */ const serializedData = SerializerMiddleware.getLazySerializedValue(item); if (serializedData !== undefined) { if (typeof serializedData === "function") { result.push(serializedData); } else { throw new Error("Not implemented"); } } else if (SerializerMiddleware.isLazy(item, this)) { throw new Error("Not implemented"); } else { const data = SerializerMiddleware.serializeLazy(item, data => this.serialize([data], context) ); SerializerMiddleware.setLazySerializedValue(item, data); result.push(data); } } else if (item === undefined) { result.push(ESCAPE, ESCAPE_UNDEFINED); } else { result.push(item); } }; try { for (const item of data) { process(item); } return result; } catch (e) { if (e === NOT_SERIALIZABLE) return null; throw e; } finally { // Get rid of these references to avoid leaking memory // This happens because the optimized code v8 generates // is optimized for our "ctx.write" method so it will reference // it from e. g. Dependency.prototype.serialize -(IC)-> ctx.write data = result = referenceable = bufferDedupeMap = objectTypeLookup = ctx = undefined; } } /** * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { let currentDataPos = 0; const read = () => { if (currentDataPos >= data.length) throw new Error("Unexpected end of stream"); return data[currentDataPos++]; }; if (read() !== CURRENT_VERSION) throw new Error("Version mismatch, serializer changed"); let currentPos = 0; let referenceable = []; const addReferenceable = item => { referenceable.push(item); currentPos++; }; let currentPosTypeLookup = 0; let objectTypeLookup = []; let result = []; let ctx = { read() { return decodeValue(); }, setCircularReference(ref) { addReferenceable(ref); }, ...context }; this.extendContext(ctx); const decodeValue = () => { const item = read(); if (item === ESCAPE) { const nextItem = read(); if (nextItem === ESCAPE_ESCAPE_VALUE) { return ESCAPE; } else if (nextItem === ESCAPE_UNDEFINED) { return undefined; } else if (nextItem === ESCAPE_END_OBJECT) { throw new Error( `Unexpected end of object at position ${currentDataPos - 1}` ); } else { const request = nextItem; let serializer; if (typeof request === "number") { if (request < 0) { // relative reference return referenceable[currentPos + request]; } serializer = objectTypeLookup[currentPosTypeLookup - request]; } else { if (typeof request !== "string") { throw new Error( `Unexpected type (${typeof request}) of request ` + `at position ${currentDataPos - 1}` ); } const name = read(); serializer = ObjectMiddleware._getDeserializerForWithoutError( request, name ); if (serializer === undefined) { if (request && !loadedRequests.has(request)) { let loaded = false; for (const [regExp, loader] of loaders) { if (regExp.test(request)) { if (loader(request)) { loaded = true; break; } } } if (!loaded) { require(request); } loadedRequests.add(request); } serializer = ObjectMiddleware.getDeserializerFor(request, name); } objectTypeLookup.push(serializer); currentPosTypeLookup++; } try { const item = serializer.deserialize(ctx); const end1 = read(); if (end1 !== ESCAPE) { throw new Error("Expected end of object"); } const end2 = read(); if (end2 !== ESCAPE_END_OBJECT) { throw new Error("Expected end of object"); } addReferenceable(item); return item; } catch (err) { // As this is only for error handling, we omit creating a Map for // faster access to this information, as this would affect performance // in the good case let serializerEntry; for (const entry of serializers) { if (entry[1].serializer === serializer) { serializerEntry = entry; break; } } const name = !serializerEntry ? "unknown" : !serializerEntry[1].request ? serializerEntry[0].name : serializerEntry[1].name ? `${serializerEntry[1].request} ${serializerEntry[1].name}` : serializerEntry[1].request; err.message += `\n(during deserialization of ${name})`; throw err; } } } else if (typeof item === "string") { if (item.length > 1) { addReferenceable(item); } return item; } else if (Buffer.isBuffer(item)) { addReferenceable(item); return item; } else if (typeof item === "function") { return SerializerMiddleware.deserializeLazy( item, data => this.deserialize(data, context)[0] ); } else { return item; } }; try { while (currentDataPos < data.length) { result.push(decodeValue()); } return result; } finally { // Get rid of these references to avoid leaking memory // This happens because the optimized code v8 generates // is optimized for our "ctx.read" method so it will reference // it from e. g. Dependency.prototype.deserialize -(IC)-> ctx.read result = referenceable = data = objectTypeLookup = ctx = undefined; } } } module.exports = ObjectMiddleware; module.exports.NOT_SERIALIZABLE = NOT_SERIALIZABLE; /***/ }), /***/ 24298: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const cache = new WeakMap(); class ObjectStructure { constructor() { this.keys = undefined; this.children = undefined; } getKeys(keys) { if (this.keys === undefined) this.keys = keys; return this.keys; } key(key) { if (this.children === undefined) this.children = new Map(); const child = this.children.get(key); if (child !== undefined) return child; const newChild = new ObjectStructure(); this.children.set(key, newChild); return newChild; } } const getCachedKeys = (keys, cacheAssoc) => { let root = cache.get(cacheAssoc); if (root === undefined) { root = new ObjectStructure(); cache.set(cacheAssoc, root); } let current = root; for (const key of keys) { current = current.key(key); } return current.getKeys(keys); }; class PlainObjectSerializer { serialize(obj, { write }) { const keys = Object.keys(obj); if (keys.length > 128) { // Objects with so many keys are unlikely to share structure // with other objects write(keys); for (const key of keys) { write(obj[key]); } } else if (keys.length > 1) { write(getCachedKeys(keys, write)); for (const key of keys) { write(obj[key]); } } else if (keys.length === 1) { const key = keys[0]; write(key); write(obj[key]); } else { write(null); } } deserialize({ read }) { const keys = read(); const obj = {}; if (Array.isArray(keys)) { for (const key of keys) { obj[key] = read(); } } else if (keys !== null) { obj[keys] = read(); } return obj; } } module.exports = PlainObjectSerializer; /***/ }), /***/ 90410: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class RegExpObjectSerializer { serialize(obj, { write }) { write(obj.source); write(obj.flags); } deserialize({ read }) { return new RegExp(read(), read()); } } module.exports = RegExpObjectSerializer; /***/ }), /***/ 24754: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class Serializer { constructor(middlewares, context) { this.serializeMiddlewares = middlewares.slice(); this.deserializeMiddlewares = middlewares.slice().reverse(); this.context = context; } serialize(obj, context) { const ctx = { ...context, ...this.context }; let current = obj; for (const middleware of this.serializeMiddlewares) { if (current && typeof current.then === "function") { current = current.then(data => data && middleware.serialize(data, ctx)); } else if (current) { try { current = middleware.serialize(current, ctx); } catch (err) { current = Promise.reject(err); } } else break; } return current; } deserialize(value, context) { const ctx = { ...context, ...this.context }; /** @type {any} */ let current = value; for (const middleware of this.deserializeMiddlewares) { if (current && typeof current.then === "function") { current = current.then(data => middleware.deserialize(data, ctx)); } else { current = middleware.deserialize(current, ctx); } } return current; } } module.exports = Serializer; /***/ }), /***/ 37063: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const memoize = __webpack_require__(84297); const LAZY_TARGET = Symbol("lazy serialization target"); const LAZY_SERIALIZED_VALUE = Symbol("lazy serialization data"); /** * @template DeserializedType * @template SerializedType */ class SerializerMiddleware { /* istanbul ignore next */ /** * @abstract * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { const AbstractMethodError = __webpack_require__(570); throw new AbstractMethodError(); } /* istanbul ignore next */ /** * @abstract * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { const AbstractMethodError = __webpack_require__(570); throw new AbstractMethodError(); } /** * @param {any | function(): Promise | any} value contained value or function to value * @param {SerializerMiddleware} target target middleware * @param {object=} options lazy options * @param {any=} serializedValue serialized value * @returns {function(): Promise | any} lazy function */ static createLazy(value, target, options = {}, serializedValue) { if (SerializerMiddleware.isLazy(value, target)) return value; const fn = typeof value === "function" ? value : () => value; fn[LAZY_TARGET] = target; /** @type {any} */ (fn).options = options; fn[LAZY_SERIALIZED_VALUE] = serializedValue; return fn; } /** * @param {function(): Promise | any} fn lazy function * @param {SerializerMiddleware=} target target middleware * @returns {boolean} true, when fn is a lazy function (optionally of that target) */ static isLazy(fn, target) { if (typeof fn !== "function") return false; const t = fn[LAZY_TARGET]; return target ? t === target : !!t; } /** * @param {function(): Promise | any} fn lazy function * @returns {object} options */ static getLazyOptions(fn) { if (typeof fn !== "function") return undefined; return /** @type {any} */ (fn).options; } /** * @param {function(): Promise | any} fn lazy function * @returns {any} serialized value */ static getLazySerializedValue(fn) { if (typeof fn !== "function") return undefined; return fn[LAZY_SERIALIZED_VALUE]; } /** * @param {function(): Promise | any} fn lazy function * @param {any} value serialized value * @returns {void} */ static setLazySerializedValue(fn, value) { fn[LAZY_SERIALIZED_VALUE] = value; } /** * @param {function(): Promise | any} lazy lazy function * @param {function(any): Promise | any} serialize serialize function * @returns {function(): Promise | any} new lazy */ static serializeLazy(lazy, serialize) { const fn = memoize(() => { const r = lazy(); if (r && typeof r.then === "function") { return r.then(data => data && serialize(data)); } return serialize(r); }); fn[LAZY_TARGET] = lazy[LAZY_TARGET]; /** @type {any} */ (fn).options = /** @type {any} */ (lazy).options; lazy[LAZY_SERIALIZED_VALUE] = fn; return fn; } /** * @param {function(): Promise | any} lazy lazy function * @param {function(any): Promise | any} deserialize deserialize function * @returns {function(): Promise | any} new lazy */ static deserializeLazy(lazy, deserialize) { const fn = memoize(() => { const r = lazy(); if (r && typeof r.then === "function") { return r.then(data => deserialize(data)); } return deserialize(r); }); fn[LAZY_TARGET] = lazy[LAZY_TARGET]; /** @type {any} */ (fn).options = /** @type {any} */ (lazy).options; fn[LAZY_SERIALIZED_VALUE] = lazy; return fn; } /** * @param {function(): Promise | any} lazy lazy function * @returns {function(): Promise | any} new lazy */ static unMemoizeLazy(lazy) { if (!SerializerMiddleware.isLazy(lazy)) return lazy; const fn = () => { throw new Error( "A lazy value that has been unmemorized can't be called again" ); }; fn[LAZY_SERIALIZED_VALUE] = SerializerMiddleware.unMemoizeLazy( lazy[LAZY_SERIALIZED_VALUE] ); fn[LAZY_TARGET] = lazy[LAZY_TARGET]; fn.options = /** @type {any} */ (lazy).options; return fn; } } module.exports = SerializerMiddleware; /***/ }), /***/ 85199: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ class SetObjectSerializer { serialize(obj, { write }) { write(obj.size); for (const value of obj) { write(value); } } deserialize({ read }) { let size = read(); const set = new Set(); for (let i = 0; i < size; i++) { set.add(read()); } return set; } } module.exports = SetObjectSerializer; /***/ }), /***/ 63340: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const SerializerMiddleware = __webpack_require__(37063); /** * @typedef {any} DeserializedType * @typedef {any[]} SerializedType * @extends {SerializerMiddleware} */ class SingleItemMiddleware extends SerializerMiddleware { /** * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { return [data]; } /** * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { return data[0]; } } module.exports = SingleItemMiddleware; /***/ }), /***/ 90489: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ModuleDependency = __webpack_require__(80944); const makeSerializable = __webpack_require__(26522); class ConsumeSharedFallbackDependency extends ModuleDependency { constructor(request) { super(request); } get type() { return "consume shared fallback"; } get category() { return "esm"; } } makeSerializable( ConsumeSharedFallbackDependency, "webpack/lib/sharing/ConsumeSharedFallbackDependency" ); module.exports = ConsumeSharedFallbackDependency; /***/ }), /***/ 61474: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { RawSource } = __webpack_require__(96192); const AsyncDependenciesBlock = __webpack_require__(11315); const Module = __webpack_require__(85887); const RuntimeGlobals = __webpack_require__(49404); const makeSerializable = __webpack_require__(26522); const { rangeToString, stringifyHoley } = __webpack_require__(60473); const ConsumeSharedFallbackDependency = __webpack_require__(90489); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */ /** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */ /** @typedef {import("../Module").LibIdentOptions} LibIdentOptions */ /** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */ /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ /** @typedef {import("../util/semver").SemVerRange} SemVerRange */ /** * @typedef {Object} ConsumeOptions * @property {string=} import fallback request * @property {string=} importResolved resolved fallback request * @property {string} shareKey global share key * @property {string} shareScope share scope * @property {SemVerRange | false | undefined} requiredVersion version requirement * @property {string} packageName package name to determine required version automatically * @property {boolean} strictVersion don't use shared version even if version isn't valid * @property {boolean} singleton use single global version * @property {boolean} eager include the fallback module in a sync way */ const TYPES = new Set(["consume-shared"]); class ConsumeSharedModule extends Module { /** * @param {string} context context * @param {ConsumeOptions} options consume options */ constructor(context, options) { super("consume-shared-module", context); this.options = options; } /** * @returns {string} a unique identifier of the module */ identifier() { const { shareKey, shareScope, importResolved, requiredVersion, strictVersion, singleton, eager } = this.options; return `consume-shared-module|${shareScope}|${shareKey}|${ requiredVersion && rangeToString(requiredVersion) }|${strictVersion}|${importResolved}|${singleton}|${eager}`; } /** * @param {RequestShortener} requestShortener the request shortener * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { const { shareKey, shareScope, importResolved, requiredVersion, strictVersion, singleton, eager } = this.options; return `consume shared module (${shareScope}) ${shareKey}@${ requiredVersion ? rangeToString(requiredVersion) : "*" }${strictVersion ? " (strict)" : ""}${singleton ? " (singleton)" : ""}${ importResolved ? ` (fallback: ${requestShortener.shorten(importResolved)})` : "" }${eager ? " (eager)" : ""}`; } /** * @param {LibIdentOptions} options options * @returns {string | null} an identifier for library inclusion */ libIdent(options) { const { shareKey, shareScope, import: request } = this.options; return `webpack/sharing/consume/${shareScope}/${shareKey}${ request ? `/${request}` : "" }`; } /** * @param {NeedBuildContext} context context info * @param {function(WebpackError=, boolean=): void} callback callback function, returns true, if the module needs a rebuild * @returns {void} */ needBuild(context, callback) { callback(null, !this.buildInfo); } /** * @param {WebpackOptions} options webpack options * @param {Compilation} compilation the compilation * @param {ResolverWithOptions} resolver the resolver * @param {InputFileSystem} fs the file system * @param {function(WebpackError=): void} callback callback function * @returns {void} */ build(options, compilation, resolver, fs, callback) { this.buildMeta = {}; this.buildInfo = {}; if (this.options.import) { const dep = new ConsumeSharedFallbackDependency(this.options.import); if (this.options.eager) { this.addDependency(dep); } else { const block = new AsyncDependenciesBlock({}); block.addDependency(dep); this.addBlock(block); } } callback(); } /** * @returns {Set} types available (do not mutate) */ getSourceTypes() { return TYPES; } /** * @param {string=} type the source type for which the size should be estimated * @returns {number} the estimated size of the module (must be non-zero) */ size(type) { return 42; } /** * @param {Hash} hash the hash used to track dependencies * @param {UpdateHashContext} context context * @returns {void} */ updateHash(hash, context) { hash.update(JSON.stringify(this.options)); super.updateHash(hash, context); } /** * @param {CodeGenerationContext} context context for code generation * @returns {CodeGenerationResult} result */ codeGeneration({ chunkGraph, moduleGraph, runtimeTemplate }) { const runtimeRequirements = new Set([RuntimeGlobals.shareScopeMap]); const { shareScope, shareKey, strictVersion, requiredVersion, import: request, singleton, eager } = this.options; let fallbackCode; if (request) { if (eager) { const dep = this.dependencies[0]; fallbackCode = runtimeTemplate.syncModuleFactory({ dependency: dep, chunkGraph, runtimeRequirements, request: this.options.import }); } else { const block = this.blocks[0]; fallbackCode = runtimeTemplate.asyncModuleFactory({ block, chunkGraph, runtimeRequirements, request: this.options.import }); } } let fn = "load"; const args = [JSON.stringify(shareScope), JSON.stringify(shareKey)]; if (requiredVersion) { if (strictVersion) { fn += "Strict"; } if (singleton) { fn += "Singleton"; } args.push(stringifyHoley(requiredVersion)); fn += "VersionCheck"; } if (fallbackCode) { fn += "Fallback"; args.push(fallbackCode); } const code = runtimeTemplate.returningFunction(`${fn}(${args.join(", ")})`); const sources = new Map(); sources.set("consume-shared", new RawSource(code)); return { runtimeRequirements, sources }; } serialize(context) { const { write } = context; write(this.options); super.serialize(context); } deserialize(context) { const { read } = context; this.options = read(); super.deserialize(context); } } makeSerializable( ConsumeSharedModule, "webpack/lib/sharing/ConsumeSharedModule" ); module.exports = ConsumeSharedModule; /***/ }), /***/ 19984: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ModuleNotFoundError = __webpack_require__(82908); const RuntimeGlobals = __webpack_require__(49404); const WebpackError = __webpack_require__(68422); const { parseOptions } = __webpack_require__(56084); const LazySet = __webpack_require__(59534); const createSchemaValidation = __webpack_require__(77695); const { parseRange } = __webpack_require__(60473); const ConsumeSharedFallbackDependency = __webpack_require__(90489); const ConsumeSharedModule = __webpack_require__(61474); const ConsumeSharedRuntimeModule = __webpack_require__(830); const ProvideForSharedDependency = __webpack_require__(40235); const { resolveMatchedConfigs } = __webpack_require__(18436); const { isRequiredVersion, getDescriptionFile, getRequiredVersionFromDescriptionFile } = __webpack_require__(58854); /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */ /** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */ const validate = createSchemaValidation( __webpack_require__(64246), () => __webpack_require__(9515), { name: "Consume Shared Plugin", baseDataPath: "options" } ); /** @type {ResolveOptionsWithDependencyType} */ const RESOLVE_OPTIONS = { dependencyType: "esm" }; const PLUGIN_NAME = "ConsumeSharedPlugin"; class ConsumeSharedPlugin { /** * @param {ConsumeSharedPluginOptions} options options */ constructor(options) { if (typeof options !== "string") { validate(options); } /** @type {[string, ConsumeOptions][]} */ this._consumes = parseOptions( options.consumes, (item, key) => { if (Array.isArray(item)) throw new Error("Unexpected array in options"); /** @type {ConsumeOptions} */ let result = item === key || !isRequiredVersion(item) ? // item is a request/key { import: key, shareScope: options.shareScope || "default", shareKey: key, requiredVersion: undefined, packageName: undefined, strictVersion: false, singleton: false, eager: false } : // key is a request/key // item is a version { import: key, shareScope: options.shareScope || "default", shareKey: key, requiredVersion: parseRange(item), strictVersion: true, packageName: undefined, singleton: false, eager: false }; return result; }, (item, key) => ({ import: item.import === false ? undefined : item.import || key, shareScope: item.shareScope || options.shareScope || "default", shareKey: item.shareKey || key, requiredVersion: typeof item.requiredVersion === "string" ? parseRange(item.requiredVersion) : item.requiredVersion, strictVersion: typeof item.strictVersion === "boolean" ? item.strictVersion : item.import !== false && !item.singleton, packageName: item.packageName, singleton: !!item.singleton, eager: !!item.eager }) ); } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.thisCompilation.tap( PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( ConsumeSharedFallbackDependency, normalModuleFactory ); let unresolvedConsumes, resolvedConsumes, prefixedConsumes; const promise = resolveMatchedConfigs(compilation, this._consumes).then( ({ resolved, unresolved, prefixed }) => { resolvedConsumes = resolved; unresolvedConsumes = unresolved; prefixedConsumes = prefixed; } ); const resolver = compilation.resolverFactory.get( "normal", RESOLVE_OPTIONS ); /** * @param {string} context issuer directory * @param {string} request request * @param {ConsumeOptions} config options * @returns {Promise} create module */ const createConsumeSharedModule = (context, request, config) => { const requiredVersionWarning = details => { const error = new WebpackError( `No required version specified and unable to automatically determine one. ${details}` ); error.file = `shared module ${request}`; compilation.warnings.push(error); }; const directFallback = config.import && /^(\.\.?(\/|$)|\/|[A-Za-z]:|\\\\)/.test(config.import); return Promise.all([ new Promise(resolve => { if (!config.import) return resolve(); const resolveContext = { /** @type {LazySet} */ fileDependencies: new LazySet(), /** @type {LazySet} */ contextDependencies: new LazySet(), /** @type {LazySet} */ missingDependencies: new LazySet() }; resolver.resolve( {}, directFallback ? compiler.context : context, config.import, resolveContext, (err, result) => { compilation.contextDependencies.addAll( resolveContext.contextDependencies ); compilation.fileDependencies.addAll( resolveContext.fileDependencies ); compilation.missingDependencies.addAll( resolveContext.missingDependencies ); if (err) { compilation.errors.push( new ModuleNotFoundError(null, err, { name: `resolving fallback for shared module ${request}` }) ); return resolve(); } resolve(result); } ); }), new Promise(resolve => { if (config.requiredVersion !== undefined) return resolve(config.requiredVersion); let packageName = config.packageName; if (packageName === undefined) { if (/^(\/|[A-Za-z]:|\\\\)/.test(request)) { // For relative or absolute requests we don't automatically use a packageName. // If wished one can specify one with the packageName option. return resolve(); } const match = /^((?:@[^\\/]+[\\/])?[^\\/]+)/.exec(request); if (!match) { requiredVersionWarning( "Unable to extract the package name from request." ); return resolve(); } packageName = match[0]; } getDescriptionFile( compilation.inputFileSystem, context, ["package.json"], (err, result) => { if (err) { requiredVersionWarning( `Unable to read description file: ${err}` ); return resolve(); } const { data, path: descriptionPath } = result; if (!data) { requiredVersionWarning( `Unable to find description file in ${context}.` ); return resolve(); } const requiredVersion = getRequiredVersionFromDescriptionFile( data, packageName ); if (typeof requiredVersion !== "string") { requiredVersionWarning( `Unable to find required version for "${packageName}" in description file (${descriptionPath}). It need to be in dependencies, devDependencies or peerDependencies.` ); return resolve(); } resolve(parseRange(requiredVersion)); } ); }) ]).then(([importResolved, requiredVersion]) => { return new ConsumeSharedModule( directFallback ? compiler.context : context, { ...config, importResolved, import: importResolved ? config.import : undefined, requiredVersion } ); }); }; normalModuleFactory.hooks.factorize.tapPromise( PLUGIN_NAME, ({ context, request, dependencies }) => // wait for resolving to be complete promise.then(() => { if ( dependencies[0] instanceof ConsumeSharedFallbackDependency || dependencies[0] instanceof ProvideForSharedDependency ) { return; } const match = unresolvedConsumes.get(request); if (match !== undefined) { return createConsumeSharedModule(context, request, match); } for (const [prefix, options] of prefixedConsumes) { if (request.startsWith(prefix)) { const remainder = request.slice(prefix.length); return createConsumeSharedModule(context, request, { ...options, import: options.import ? options.import + remainder : undefined, shareKey: options.shareKey + remainder }); } } }) ); normalModuleFactory.hooks.createModule.tapPromise( PLUGIN_NAME, ({ resource }, { context, dependencies }) => { if ( dependencies[0] instanceof ConsumeSharedFallbackDependency || dependencies[0] instanceof ProvideForSharedDependency ) { return Promise.resolve(); } const options = resolvedConsumes.get(resource); if (options !== undefined) { return createConsumeSharedModule(context, resource, options); } return Promise.resolve(); } ); compilation.hooks.additionalTreeRuntimeRequirements.tap( PLUGIN_NAME, (chunk, set) => { set.add(RuntimeGlobals.module); set.add(RuntimeGlobals.moduleCache); set.add(RuntimeGlobals.moduleFactoriesAddOnly); set.add(RuntimeGlobals.shareScopeMap); set.add(RuntimeGlobals.initializeSharing); set.add(RuntimeGlobals.hasOwnProperty); compilation.addRuntimeModule( chunk, new ConsumeSharedRuntimeModule(set) ); } ); } ); } } module.exports = ConsumeSharedPlugin; /***/ }), /***/ 830: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); const { parseVersionRuntimeCode, versionLtRuntimeCode, rangeToStringRuntimeCode, satisfyRuntimeCode } = __webpack_require__(60473); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Module")} Module */ /** @typedef {import("./ConsumeSharedModule")} ConsumeSharedModule */ class ConsumeSharedRuntimeModule extends RuntimeModule { constructor(runtimeRequirements) { super("consumes", RuntimeModule.STAGE_ATTACH); this._runtimeRequirements = runtimeRequirements; } /** * @returns {string} runtime code */ generate() { const { compilation, chunkGraph } = this; const { runtimeTemplate, codeGenerationResults } = compilation; const chunkToModuleMapping = {}; /** @type {Map} */ const moduleIdToSourceMapping = new Map(); const initialConsumes = []; /** * * @param {Iterable} modules modules * @param {Chunk} chunk the chunk * @param {(string | number)[]} list list of ids */ const addModules = (modules, chunk, list) => { for (const m of modules) { const module = /** @type {ConsumeSharedModule} */ (m); const id = chunkGraph.getModuleId(module); list.push(id); moduleIdToSourceMapping.set( id, codeGenerationResults.getSource( module, chunk.runtime, "consume-shared" ) ); } }; for (const chunk of this.chunk.getAllAsyncChunks()) { const modules = chunkGraph.getChunkModulesIterableBySourceType( chunk, "consume-shared" ); if (!modules) continue; addModules(modules, chunk, (chunkToModuleMapping[chunk.id] = [])); } for (const chunk of this.chunk.getAllInitialChunks()) { const modules = chunkGraph.getChunkModulesIterableBySourceType( chunk, "consume-shared" ); if (!modules) continue; addModules(modules, chunk, initialConsumes); } if (moduleIdToSourceMapping.size === 0) return null; return Template.asString([ parseVersionRuntimeCode(runtimeTemplate), versionLtRuntimeCode(runtimeTemplate), rangeToStringRuntimeCode(runtimeTemplate), satisfyRuntimeCode(runtimeTemplate), `var ensureExistence = ${runtimeTemplate.basicFunction("scopeName, key", [ `var scope = ${RuntimeGlobals.shareScopeMap}[scopeName];`, `if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) throw new Error("Shared module " + key + " doesn't exist in shared scope " + scopeName);`, "return scope;" ])};`, `var findVersion = ${runtimeTemplate.basicFunction("scope, key", [ "var versions = scope[key];", `var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( "a, b", ["return !a || versionLt(a, b) ? b : a;"] )}, 0);`, "return key && versions[key]" ])};`, `var findSingletonVersionKey = ${runtimeTemplate.basicFunction( "scope, key", [ "var versions = scope[key];", `return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( "a, b", ["return !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;"] )}, 0);` ] )};`, `var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction( "scope, key, version, requiredVersion", [ `return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"` ] )};`, `var getSingletonVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ "var version = findSingletonVersionKey(scope, key);", "if (!satisfy(requiredVersion, version)) " + 'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));', "return get(scope[key][version]);" ] )};`, `var getStrictSingletonVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ "var version = findSingletonVersionKey(scope, key);", "if (!satisfy(requiredVersion, version)) " + "throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", "return get(scope[key][version]);" ] )};`, `var findValidVersion = ${runtimeTemplate.basicFunction( "scope, key, requiredVersion", [ "var versions = scope[key];", `var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( "a, b", [ "if (!satisfy(requiredVersion, b)) return a;", "return !a || versionLt(a, b) ? b : a;" ] )}, 0);`, "return key && versions[key]" ] )};`, `var getInvalidVersionMessage = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ "var versions = scope[key];", 'return "No satisfying version (" + rangeToString(requiredVersion) + ") of shared module " + key + " found in shared scope " + scopeName + ".\\n" +', `\t"Available versions: " + Object.keys(versions).map(${runtimeTemplate.basicFunction( "key", ['return key + " from " + versions[key].from;'] )}).join(", ");` ] )};`, `var getValidVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ "var entry = findValidVersion(scope, key, requiredVersion);", "if(entry) return get(entry);", "throw new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" ] )};`, `var warnInvalidVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ 'typeof console !== "undefined" && console.warn && console.warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));' ] )};`, `var get = ${runtimeTemplate.basicFunction("entry", [ "entry.loaded = 1;", "return entry.get()" ])};`, `var init = ${runtimeTemplate.returningFunction( Template.asString([ "function(scopeName, a, b, c) {", Template.indent([ `var promise = ${RuntimeGlobals.initializeSharing}(scopeName);`, `if (promise && promise.then) return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c));`, `return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c);` ]), "}" ]), "fn" )};`, "", `var load = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key", [ "ensureExistence(scopeName, key);", "return get(findVersion(scope, key));" ] )});`, `var loadFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, fallback", [ `return scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) ? get(findVersion(scope, key)) : fallback();` ] )});`, `var loadVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version", [ "ensureExistence(scopeName, key);", "return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" ] )});`, `var loadSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version", [ "ensureExistence(scopeName, key);", "return getSingletonVersion(scope, scopeName, key, version);" ] )});`, `var loadStrictVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version", [ "ensureExistence(scopeName, key);", "return getValidVersion(scope, scopeName, key, version);" ] )});`, `var loadStrictSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version", [ "ensureExistence(scopeName, key);", "return getStrictSingletonVersion(scope, scopeName, key, version);" ] )});`, `var loadVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version, fallback", [ `if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, "return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" ] )});`, `var loadSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version, fallback", [ `if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, "return getSingletonVersion(scope, scopeName, key, version);" ] )});`, `var loadStrictVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version, fallback", [ `var entry = scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) && findValidVersion(scope, key, version);`, `return entry ? get(entry) : fallback();` ] )});`, `var loadStrictSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( "scopeName, scope, key, version, fallback", [ `if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, "return getStrictSingletonVersion(scope, scopeName, key, version);" ] )});`, "var installedModules = {};", "var moduleToHandlerMapping = {", Template.indent( Array.from( moduleIdToSourceMapping, ([key, source]) => `${JSON.stringify(key)}: ${source.source()}` ).join(",\n") ), "};", initialConsumes.length > 0 ? Template.asString([ `var initialConsumes = ${JSON.stringify(initialConsumes)};`, `initialConsumes.forEach(${runtimeTemplate.basicFunction("id", [ `${ RuntimeGlobals.moduleFactories }[id] = ${runtimeTemplate.basicFunction("module", [ "// Handle case when module is used sync", "installedModules[id] = 0;", `delete ${RuntimeGlobals.moduleCache}[id];`, "var factory = moduleToHandlerMapping[id]();", 'if(typeof factory !== "function") throw new Error("Shared module is not available for eager consumption: " + id);', `module.exports = factory();` ])}` ])});` ]) : "// no consumes in initial chunks", this._runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers) ? Template.asString([ `var chunkMapping = ${JSON.stringify( chunkToModuleMapping, null, "\t" )};`, `${ RuntimeGlobals.ensureChunkHandlers }.consumes = ${runtimeTemplate.basicFunction("chunkId, promises", [ `if(${RuntimeGlobals.hasOwnProperty}(chunkMapping, chunkId)) {`, Template.indent([ `chunkMapping[chunkId].forEach(${runtimeTemplate.basicFunction( "id", [ `if(${RuntimeGlobals.hasOwnProperty}(installedModules, id)) return promises.push(installedModules[id]);`, `var onFactory = ${runtimeTemplate.basicFunction( "factory", [ "installedModules[id] = 0;", `${ RuntimeGlobals.moduleFactories }[id] = ${runtimeTemplate.basicFunction("module", [ `delete ${RuntimeGlobals.moduleCache}[id];`, "module.exports = factory();" ])}` ] )};`, `var onError = ${runtimeTemplate.basicFunction("error", [ "delete installedModules[id];", `${ RuntimeGlobals.moduleFactories }[id] = ${runtimeTemplate.basicFunction("module", [ `delete ${RuntimeGlobals.moduleCache}[id];`, "throw error;" ])}` ])};`, "try {", Template.indent([ "var promise = moduleToHandlerMapping[id]();", "if(promise.then) {", Template.indent( "promises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));" ), "} else onFactory(promise);" ]), "} catch(e) { onError(e); }" ] )});` ]), "}" ])}` ]) : "// no chunk loading of consumes" ]); } } module.exports = ConsumeSharedRuntimeModule; /***/ }), /***/ 40235: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ModuleDependency = __webpack_require__(80944); const makeSerializable = __webpack_require__(26522); class ProvideForSharedDependency extends ModuleDependency { /** * * @param {string} request request string */ constructor(request) { super(request); } get type() { return "provide module for shared"; } get category() { return "esm"; } } makeSerializable( ProvideForSharedDependency, "webpack/lib/sharing/ProvideForSharedDependency" ); module.exports = ProvideForSharedDependency; /***/ }), /***/ 99355: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Dependency = __webpack_require__(50384); const makeSerializable = __webpack_require__(26522); class ProvideSharedDependency extends Dependency { constructor(shareScope, name, version, request, eager) { super(); this.shareScope = shareScope; this.name = name; this.version = version; this.request = request; this.eager = eager; } get type() { return "provide shared module"; } /** * @returns {string | null} an identifier to merge equal requests */ getResourceIdentifier() { return `provide module (${this.shareScope}) ${this.request} as ${ this.name } @ ${this.version}${this.eager ? " (eager)" : ""}`; } serialize(context) { context.write(this.shareScope); context.write(this.name); context.write(this.request); context.write(this.version); context.write(this.eager); super.serialize(context); } static deserialize(context) { const { read } = context; const obj = new ProvideSharedDependency( read(), read(), read(), read(), read() ); this.shareScope = context.read(); obj.deserialize(context); return obj; } } makeSerializable( ProvideSharedDependency, "webpack/lib/sharing/ProvideSharedDependency" ); module.exports = ProvideSharedDependency; /***/ }), /***/ 65945: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy */ const AsyncDependenciesBlock = __webpack_require__(11315); const Module = __webpack_require__(85887); const RuntimeGlobals = __webpack_require__(49404); const makeSerializable = __webpack_require__(26522); const ProvideForSharedDependency = __webpack_require__(40235); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */ /** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */ /** @typedef {import("../Module").LibIdentOptions} LibIdentOptions */ /** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */ /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ const TYPES = new Set(["share-init"]); class ProvideSharedModule extends Module { /** * @param {string} shareScope shared scope name * @param {string} name shared key * @param {string | false} version version * @param {string} request request to the provided module * @param {boolean} eager include the module in sync way */ constructor(shareScope, name, version, request, eager) { super("provide-module"); this._shareScope = shareScope; this._name = name; this._version = version; this._request = request; this._eager = eager; } /** * @returns {string} a unique identifier of the module */ identifier() { return `provide module (${this._shareScope}) ${this._name}@${this._version} = ${this._request}`; } /** * @param {RequestShortener} requestShortener the request shortener * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { return `provide shared module (${this._shareScope}) ${this._name}@${ this._version } = ${requestShortener.shorten(this._request)}`; } /** * @param {LibIdentOptions} options options * @returns {string | null} an identifier for library inclusion */ libIdent(options) { return `webpack/sharing/provide/${this._shareScope}/${this._name}`; } /** * @param {NeedBuildContext} context context info * @param {function(WebpackError=, boolean=): void} callback callback function, returns true, if the module needs a rebuild * @returns {void} */ needBuild(context, callback) { callback(null, !this.buildInfo); } /** * @param {WebpackOptions} options webpack options * @param {Compilation} compilation the compilation * @param {ResolverWithOptions} resolver the resolver * @param {InputFileSystem} fs the file system * @param {function(WebpackError=): void} callback callback function * @returns {void} */ build(options, compilation, resolver, fs, callback) { this.buildMeta = {}; this.buildInfo = { strict: true }; this.clearDependenciesAndBlocks(); const dep = new ProvideForSharedDependency(this._request); if (this._eager) { this.addDependency(dep); } else { const block = new AsyncDependenciesBlock({}); block.addDependency(dep); this.addBlock(block); } callback(); } /** * @param {string=} type the source type for which the size should be estimated * @returns {number} the estimated size of the module (must be non-zero) */ size(type) { return 42; } /** * @returns {Set} types available (do not mutate) */ getSourceTypes() { return TYPES; } /** * @param {CodeGenerationContext} context context for code generation * @returns {CodeGenerationResult} result */ codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph }) { const runtimeRequirements = new Set([RuntimeGlobals.initializeSharing]); const code = `register(${JSON.stringify(this._name)}, ${JSON.stringify( this._version || "0" )}, ${ this._eager ? runtimeTemplate.syncModuleFactory({ dependency: this.dependencies[0], chunkGraph, request: this._request, runtimeRequirements }) : runtimeTemplate.asyncModuleFactory({ block: this.blocks[0], chunkGraph, request: this._request, runtimeRequirements }) }${this._eager ? ", 1" : ""});`; const sources = new Map(); const data = new Map(); data.set("share-init", [ { shareScope: this._shareScope, initStage: 10, init: code } ]); return { sources, data, runtimeRequirements }; } serialize(context) { const { write } = context; write(this._shareScope); write(this._name); write(this._version); write(this._request); write(this._eager); super.serialize(context); } static deserialize(context) { const { read } = context; const obj = new ProvideSharedModule(read(), read(), read(), read(), read()); obj.deserialize(context); return obj; } } makeSerializable( ProvideSharedModule, "webpack/lib/sharing/ProvideSharedModule" ); module.exports = ProvideSharedModule; /***/ }), /***/ 89859: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy */ const ModuleFactory = __webpack_require__(61574); const ProvideSharedModule = __webpack_require__(65945); /** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("../ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ /** @typedef {import("./ProvideSharedDependency")} ProvideSharedDependency */ class ProvideSharedModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object * @param {function(Error=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { const dep = /** @type {ProvideSharedDependency} */ (data.dependencies[0]); callback(null, { module: new ProvideSharedModule( dep.shareScope, dep.name, dep.version, dep.request, dep.eager ) }); } } module.exports = ProvideSharedModuleFactory; /***/ }), /***/ 42672: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy */ const WebpackError = __webpack_require__(68422); const { parseOptions } = __webpack_require__(56084); const createSchemaValidation = __webpack_require__(77695); const ProvideForSharedDependency = __webpack_require__(40235); const ProvideSharedDependency = __webpack_require__(99355); const ProvideSharedModuleFactory = __webpack_require__(89859); /** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( __webpack_require__(31011), () => __webpack_require__(12287), { name: "Provide Shared Plugin", baseDataPath: "options" } ); /** * @typedef {Object} ProvideOptions * @property {string} shareKey * @property {string} shareScope * @property {string | undefined | false} version * @property {boolean} eager */ /** @typedef {Map} ResolvedProvideMap */ class ProvideSharedPlugin { /** * @param {ProvideSharedPluginOptions} options options */ constructor(options) { validate(options); /** @type {[string, ProvideOptions][]} */ this._provides = parseOptions( options.provides, item => { if (Array.isArray(item)) throw new Error("Unexpected array of provides"); /** @type {ProvideOptions} */ const result = { shareKey: item, version: undefined, shareScope: options.shareScope || "default", eager: false }; return result; }, item => ({ shareKey: item.shareKey, version: item.version, shareScope: item.shareScope || options.shareScope || "default", eager: !!item.eager }) ); this._provides.sort(([a], [b]) => { if (a < b) return -1; if (b < a) return 1; return 0; }); } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { /** @type {WeakMap} */ const compilationData = new WeakMap(); compiler.hooks.compilation.tap( "ProvideSharedPlugin", (compilation, { normalModuleFactory }) => { /** @type {ResolvedProvideMap} */ const resolvedProvideMap = new Map(); /** @type {Map} */ const matchProvides = new Map(); /** @type {Map} */ const prefixMatchProvides = new Map(); for (const [request, config] of this._provides) { if (/^(\/|[A-Za-z]:\\|\\\\|\.\.?(\/|$))/.test(request)) { // relative request resolvedProvideMap.set(request, { config, version: config.version }); } else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) { // absolute path resolvedProvideMap.set(request, { config, version: config.version }); } else if (request.endsWith("/")) { // module request prefix prefixMatchProvides.set(request, config); } else { // module request matchProvides.set(request, config); } } compilationData.set(compilation, resolvedProvideMap); const provideSharedModule = ( key, config, resource, resourceResolveData ) => { let version = config.version; if (version === undefined) { let details = ""; if (!resourceResolveData) { details = `No resolve data provided from resolver.`; } else { const descriptionFileData = resourceResolveData.descriptionFileData; if (!descriptionFileData) { details = "No description file (usually package.json) found. Add description file with name and version, or manually specify version in shared config."; } else if (!descriptionFileData.version) { details = "No version in description file (usually package.json). Add version to description file, or manually specify version in shared config."; } else { version = descriptionFileData.version; } } if (!version) { const error = new WebpackError( `No version specified and unable to automatically determine one. ${details}` ); error.file = `shared module ${key} -> ${resource}`; compilation.warnings.push(error); } } resolvedProvideMap.set(resource, { config, version }); }; normalModuleFactory.hooks.module.tap( "ProvideSharedPlugin", (module, { resource, resourceResolveData }, resolveData) => { if (resolvedProvideMap.has(resource)) { return module; } const { request } = resolveData; { const config = matchProvides.get(request); if (config !== undefined) { provideSharedModule( request, config, resource, resourceResolveData ); resolveData.cacheable = false; } } for (const [prefix, config] of prefixMatchProvides) { if (request.startsWith(prefix)) { const remainder = request.slice(prefix.length); provideSharedModule( resource, { ...config, shareKey: config.shareKey + remainder }, resource, resourceResolveData ); resolveData.cacheable = false; } } return module; } ); } ); compiler.hooks.finishMake.tapPromise("ProvideSharedPlugin", compilation => { const resolvedProvideMap = compilationData.get(compilation); if (!resolvedProvideMap) return Promise.resolve(); return Promise.all( Array.from( resolvedProvideMap, ([resource, { config, version }]) => new Promise((resolve, reject) => { compilation.addInclude( compiler.context, new ProvideSharedDependency( config.shareScope, config.shareKey, version || false, resource, config.eager ), { name: undefined }, err => { if (err) return reject(err); resolve(); } ); }) ) ).then(() => {}); }); compiler.hooks.compilation.tap( "ProvideSharedPlugin", (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( ProvideForSharedDependency, normalModuleFactory ); compilation.dependencyFactories.set( ProvideSharedDependency, new ProvideSharedModuleFactory() ); } ); } } module.exports = ProvideSharedPlugin; /***/ }), /***/ 25790: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy */ const { parseOptions } = __webpack_require__(56084); const ConsumeSharedPlugin = __webpack_require__(19984); const ProvideSharedPlugin = __webpack_require__(42672); const { isRequiredVersion } = __webpack_require__(58854); /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */ /** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvidesConfig} ProvidesConfig */ /** @typedef {import("../../declarations/plugins/sharing/SharePlugin").SharePluginOptions} SharePluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/SharePlugin").SharedConfig} SharedConfig */ /** @typedef {import("../Compiler")} Compiler */ class SharePlugin { /** * @param {SharePluginOptions} options options */ constructor(options) { /** @type {[string, SharedConfig][]} */ const sharedOptions = parseOptions( options.shared, (item, key) => { if (typeof item !== "string") throw new Error("Unexpected array in shared"); /** @type {SharedConfig} */ const config = item === key || !isRequiredVersion(item) ? { import: item } : { import: key, requiredVersion: item }; return config; }, item => item ); /** @type {Record[]} */ const consumes = sharedOptions.map(([key, options]) => ({ [key]: { import: options.import, shareKey: options.shareKey || key, shareScope: options.shareScope, requiredVersion: options.requiredVersion, strictVersion: options.strictVersion, singleton: options.singleton, packageName: options.packageName, eager: options.eager } })); /** @type {Record[]} */ const provides = sharedOptions .filter(([, options]) => options.import !== false) .map(([key, options]) => ({ [options.import || key]: { shareKey: options.shareKey || key, shareScope: options.shareScope, version: options.version, eager: options.eager } })); this._shareScope = options.shareScope; this._consumes = consumes; this._provides = provides; } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { new ConsumeSharedPlugin({ shareScope: this._shareScope, consumes: this._consumes }).apply(compiler); new ProvideSharedPlugin({ shareScope: this._shareScope, provides: this._provides }).apply(compiler); } } module.exports = SharePlugin; /***/ }), /***/ 97207: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); const { compareModulesByIdentifier, compareStrings } = __webpack_require__(26296); class ShareRuntimeModule extends RuntimeModule { constructor() { super("sharing"); } /** * @returns {string} runtime code */ generate() { const { compilation, chunkGraph } = this; const { runtimeTemplate, codeGenerationResults, outputOptions: { uniqueName } } = compilation; /** @type {Map>>} */ const initCodePerScope = new Map(); for (const chunk of this.chunk.getAllReferencedChunks()) { const modules = chunkGraph.getOrderedChunkModulesIterableBySourceType( chunk, "share-init", compareModulesByIdentifier ); if (!modules) continue; for (const m of modules) { const data = codeGenerationResults.getData( m, chunk.runtime, "share-init" ); if (!data) continue; for (const item of data) { const { shareScope, initStage, init } = item; let stages = initCodePerScope.get(shareScope); if (stages === undefined) { initCodePerScope.set(shareScope, (stages = new Map())); } let list = stages.get(initStage || 0); if (list === undefined) { stages.set(initStage || 0, (list = new Set())); } list.add(init); } } } return Template.asString([ `${RuntimeGlobals.shareScopeMap} = {};`, "var initPromises = {};", "var initTokens = {};", `${RuntimeGlobals.initializeSharing} = ${runtimeTemplate.basicFunction( "name, initScope", [ "if(!initScope) initScope = [];", "// handling circular init calls", "var initToken = initTokens[name];", "if(!initToken) initToken = initTokens[name] = {};", "if(initScope.indexOf(initToken) >= 0) return;", "initScope.push(initToken);", "// only runs once", "if(initPromises[name]) return initPromises[name];", "// creates a new share scope if needed", `if(!${RuntimeGlobals.hasOwnProperty}(${RuntimeGlobals.shareScopeMap}, name)) ${RuntimeGlobals.shareScopeMap}[name] = {};`, "// runs all init snippets from all modules reachable", `var scope = ${RuntimeGlobals.shareScopeMap}[name];`, `var warn = ${runtimeTemplate.returningFunction( 'typeof console !== "undefined" && console.warn && console.warn(msg)', "msg" )};`, `var uniqueName = ${JSON.stringify(uniqueName || undefined)};`, `var register = ${runtimeTemplate.basicFunction( "name, version, factory, eager", [ "var versions = scope[name] = scope[name] || {};", "var activeVersion = versions[version];", "if(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };" ] )};`, `var initExternal = ${runtimeTemplate.basicFunction("id", [ `var handleError = ${runtimeTemplate.expressionFunction( 'warn("Initialization of sharing external failed: " + err)', "err" )};`, "try {", Template.indent([ "var module = __webpack_require__(id);", "if(!module) return;", `var initFn = ${runtimeTemplate.returningFunction( `module && module.init && module.init(${RuntimeGlobals.shareScopeMap}[name], initScope)`, "module" )}`, "if(module.then) return promises.push(module.then(initFn, handleError));", "var initResult = initFn(module);", "if(initResult && initResult.then) return promises.push(initResult['catch'](handleError));" ]), "} catch(err) { handleError(err); }" ])}`, "var promises = [];", "switch(name) {", ...Array.from(initCodePerScope) .sort(([a], [b]) => compareStrings(a, b)) .map(([name, stages]) => Template.indent([ `case ${JSON.stringify(name)}: {`, Template.indent( Array.from(stages) .sort(([a], [b]) => a - b) .map(([, initCode]) => Template.asString(Array.from(initCode)) ) ), "}", "break;" ]) ), "}", "if(!promises.length) return initPromises[name] = 1;", `return initPromises[name] = Promise.all(promises).then(${runtimeTemplate.returningFunction( "initPromises[name] = 1" )});` ] )};` ]); } } module.exports = ShareRuntimeModule; /***/ }), /***/ 18436: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ModuleNotFoundError = __webpack_require__(82908); const LazySet = __webpack_require__(59534); /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */ /** * @template T * @typedef {Object} MatchedConfigs * @property {Map} resolved * @property {Map} unresolved * @property {Map} prefixed */ /** @type {ResolveOptionsWithDependencyType} */ const RESOLVE_OPTIONS = { dependencyType: "esm" }; /** * @template T * @param {Compilation} compilation the compilation * @param {[string, T][]} configs to be processed configs * @returns {Promise>} resolved matchers */ exports.resolveMatchedConfigs = (compilation, configs) => { /** @type {Map} */ const resolved = new Map(); /** @type {Map} */ const unresolved = new Map(); /** @type {Map} */ const prefixed = new Map(); const resolveContext = { /** @type {LazySet} */ fileDependencies: new LazySet(), /** @type {LazySet} */ contextDependencies: new LazySet(), /** @type {LazySet} */ missingDependencies: new LazySet() }; const resolver = compilation.resolverFactory.get("normal", RESOLVE_OPTIONS); const context = compilation.compiler.context; return Promise.all( configs.map(([request, config]) => { if (/^\.\.?(\/|$)/.test(request)) { // relative request return new Promise(resolve => { resolver.resolve( {}, context, request, resolveContext, (err, result) => { if (err || result === false) { err = err || new Error(`Can't resolve ${request}`); compilation.errors.push( new ModuleNotFoundError(null, err, { name: `shared module ${request}` }) ); return resolve(); } resolved.set(result, config); resolve(); } ); }); } else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) { // absolute path resolved.set(request, config); } else if (request.endsWith("/")) { // module request prefix prefixed.set(request, config); } else { // module request unresolved.set(request, config); } }) ).then(() => { compilation.contextDependencies.addAll(resolveContext.contextDependencies); compilation.fileDependencies.addAll(resolveContext.fileDependencies); compilation.missingDependencies.addAll(resolveContext.missingDependencies); return { resolved, unresolved, prefixed }; }); }; /***/ }), /***/ 58854: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { join, dirname, readJson } = __webpack_require__(93204); /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ /** * @param {string} str maybe required version * @returns {boolean} true, if it looks like a version */ exports.isRequiredVersion = str => { return /^([\d^=v<>~]|[*xX]$)/.test(str); }; /** * * @param {InputFileSystem} fs file system * @param {string} directory directory to start looking into * @param {string[]} descriptionFiles possible description filenames * @param {function(Error=, {data: object, path: string}=): void} callback callback */ const getDescriptionFile = (fs, directory, descriptionFiles, callback) => { let i = 0; const tryLoadCurrent = () => { if (i >= descriptionFiles.length) { const parentDirectory = dirname(fs, directory); if (!parentDirectory || parentDirectory === directory) return callback(); return getDescriptionFile( fs, parentDirectory, descriptionFiles, callback ); } const filePath = join(fs, directory, descriptionFiles[i]); readJson(fs, filePath, (err, data) => { if (err) { if ("code" in err && err.code === "ENOENT") { i++; return tryLoadCurrent(); } return callback(err); } if (!data || typeof data !== "object" || Array.isArray(data)) { return callback( new Error(`Description file ${filePath} is not an object`) ); } callback(null, { data, path: filePath }); }); }; tryLoadCurrent(); }; exports.getDescriptionFile = getDescriptionFile; exports.getRequiredVersionFromDescriptionFile = (data, packageName) => { if ( data.optionalDependencies && typeof data.optionalDependencies === "object" && packageName in data.optionalDependencies ) { return data.optionalDependencies[packageName]; } if ( data.dependencies && typeof data.dependencies === "object" && packageName in data.dependencies ) { return data.dependencies[packageName]; } if ( data.peerDependencies && typeof data.peerDependencies === "object" && packageName in data.peerDependencies ) { return data.peerDependencies[packageName]; } if ( data.devDependencies && typeof data.devDependencies === "object" && packageName in data.devDependencies ) { return data.devDependencies[packageName]; } }; /***/ }), /***/ 91293: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const util = __webpack_require__(31669); const ModuleDependency = __webpack_require__(80944); const formatLocation = __webpack_require__(57261); const { LogType } = __webpack_require__(54667); const AggressiveSplittingPlugin = __webpack_require__(10055); const SizeLimitsPlugin = __webpack_require__(64025); const { countIterable } = __webpack_require__(31065); const { compareLocations, compareChunksById, compareNumbers, compareIds, concatComparators, compareSelect, compareModulesByIdentifier } = __webpack_require__(26296); const { makePathsRelative, parseResource } = __webpack_require__(96236); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../ChunkGroup").OriginRecord} OriginRecord */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compilation").Asset} Asset */ /** @typedef {import("../Compilation").AssetInfo} AssetInfo */ /** @typedef {import("../Compilation").NormalizedStatsOptions} NormalizedStatsOptions */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleProfile")} ModuleProfile */ /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../WebpackError")} WebpackError */ /** @template T @typedef {import("../util/comparators").Comparator} Comparator */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ /** @typedef {import("../util/smartGrouping").GroupConfig} GroupConfig */ /** @typedef {import("./StatsFactory")} StatsFactory */ /** @typedef {import("./StatsFactory").StatsFactoryContext} StatsFactoryContext */ /** @typedef {KnownStatsCompilation & Record} StatsCompilation */ /** * @typedef {Object} KnownStatsCompilation * @property {any=} env * @property {string=} name * @property {string=} hash * @property {string=} version * @property {number=} time * @property {number=} builtAt * @property {boolean=} needAdditionalPass * @property {string=} publicPath * @property {string=} outputPath * @property {Record=} assetsByChunkName * @property {StatsAsset[]=} assets * @property {number=} filteredAssets * @property {StatsChunk[]=} chunks * @property {StatsModule[]=} modules * @property {number=} filteredModules * @property {Record=} entrypoints * @property {Record=} namedChunkGroups * @property {StatsError[]=} errors * @property {number=} errorsCount * @property {StatsError[]=} warnings * @property {number=} warningsCount * @property {StatsCompilation[]=} children * @property {Record=} logging */ /** @typedef {KnownStatsLogging & Record} StatsLogging */ /** * @typedef {Object} KnownStatsLogging * @property {StatsLoggingEntry[]} entries * @property {number} filteredEntries * @property {boolean} debug */ /** @typedef {KnownStatsLoggingEntry & Record} StatsLoggingEntry */ /** * @typedef {Object} KnownStatsLoggingEntry * @property {string} type * @property {string} message * @property {string[]=} trace * @property {StatsLoggingEntry[]=} children * @property {any[]=} args * @property {number=} time */ /** @typedef {KnownStatsAsset & Record} StatsAsset */ /** * @typedef {Object} KnownStatsAsset * @property {string} type * @property {string} name * @property {AssetInfo} info * @property {number} size * @property {boolean} emitted * @property {boolean} comparedForEmit * @property {boolean} cached * @property {StatsAsset[]=} related * @property {(string|number)[]=} chunkNames * @property {(string|number)[]=} chunkIdHints * @property {(string|number)[]=} chunks * @property {(string|number)[]=} auxiliaryChunkNames * @property {(string|number)[]=} auxiliaryChunks * @property {(string|number)[]=} auxiliaryChunkIdHints * @property {number=} filteredRelated * @property {boolean=} isOverSizeLimit */ /** @typedef {KnownStatsChunkGroup & Record} StatsChunkGroup */ /** * @typedef {Object} KnownStatsChunkGroup * @property {string=} name * @property {(string|number)[]=} chunks * @property {({ name: string, size?: number })[]=} assets * @property {number=} filteredAssets * @property {number=} assetsSize * @property {({ name: string, size?: number })[]=} auxiliaryAssets * @property {number=} filteredAuxiliaryAssets * @property {number=} auxiliaryAssetsSize * @property {{ [x: string]: StatsChunkGroup[] }=} children * @property {{ [x: string]: string[] }=} childAssets * @property {boolean=} isOverSizeLimit */ /** @typedef {KnownStatsModule & Record} StatsModule */ /** * @typedef {Object} KnownStatsModule * @property {string=} type * @property {string=} moduleType * @property {string=} layer * @property {string=} identifier * @property {string=} name * @property {string=} nameForCondition * @property {number=} index * @property {number=} preOrderIndex * @property {number=} index2 * @property {number=} postOrderIndex * @property {number=} size * @property {{[x: string]: number}=} sizes * @property {boolean=} cacheable * @property {boolean=} built * @property {boolean=} codeGenerated * @property {boolean=} buildTimeExecuted * @property {boolean=} cached * @property {boolean=} optional * @property {boolean=} orphan * @property {string|number=} id * @property {string|number=} issuerId * @property {(string|number)[]=} chunks * @property {(string|number)[]=} assets * @property {boolean=} dependent * @property {string=} issuer * @property {string=} issuerName * @property {StatsModuleIssuer[]=} issuerPath * @property {boolean=} failed * @property {number=} errors * @property {number=} warnings * @property {StatsProfile=} profile * @property {StatsModuleReason[]=} reasons * @property {(boolean | string[])=} usedExports * @property {string[]=} providedExports * @property {string[]=} optimizationBailout * @property {number=} depth * @property {StatsModule[]=} modules * @property {number=} filteredModules * @property {ReturnType=} source */ /** @typedef {KnownStatsProfile & Record} StatsProfile */ /** * @typedef {Object} KnownStatsProfile * @property {number} total * @property {number} resolving * @property {number} restoring * @property {number} building * @property {number} integration * @property {number} storing * @property {number} additionalResolving * @property {number} additionalIntegration * @property {number} factory * @property {number} dependencies */ /** @typedef {KnownStatsModuleIssuer & Record} StatsModuleIssuer */ /** * @typedef {Object} KnownStatsModuleIssuer * @property {string=} identifier * @property {string=} name * @property {(string|number)=} id * @property {StatsProfile=} profile */ /** @typedef {KnownStatsModuleReason & Record} StatsModuleReason */ /** * @typedef {Object} KnownStatsModuleReason * @property {string=} moduleIdentifier * @property {string=} module * @property {string=} moduleName * @property {string=} resolvedModuleIdentifier * @property {string=} resolvedModule * @property {string=} type * @property {boolean} active * @property {string=} explanation * @property {string=} userRequest * @property {string=} loc * @property {(string|number)=} moduleId * @property {(string|number)=} resolvedModuleId */ /** @typedef {KnownStatsChunk & Record} StatsChunk */ /** * @typedef {Object} KnownStatsChunk * @property {boolean} rendered * @property {boolean} initial * @property {boolean} entry * @property {boolean} recorded * @property {string=} reason * @property {number} size * @property {Record=} sizes * @property {string[]=} names * @property {string[]=} idHints * @property {string[]=} runtime * @property {string[]=} files * @property {string[]=} auxiliaryFiles * @property {string} hash * @property {Record=} childrenByOrder * @property {(string|number)=} id * @property {(string|number)[]=} siblings * @property {(string|number)[]=} parents * @property {(string|number)[]=} children * @property {StatsModule[]=} modules * @property {number=} filteredModules * @property {StatsChunkOrigin[]=} origins */ /** @typedef {KnownStatsChunkOrigin & Record} StatsChunkOrigin */ /** * @typedef {Object} KnownStatsChunkOrigin * @property {string=} module * @property {string=} moduleIdentifier * @property {string=} moduleName * @property {string=} loc * @property {string=} request * @property {(string|number)=} moduleId */ /** @typedef {KnownStatsModuleTraceItem & Record} StatsModuleTraceItem */ /** * @typedef {Object} KnownStatsModuleTraceItem * @property {string=} originIdentifier * @property {string=} originName * @property {string=} moduleIdentifier * @property {string=} moduleName * @property {StatsModuleTraceDependency[]=} dependencies * @property {(string|number)=} originId * @property {(string|number)=} moduleId */ /** @typedef {KnownStatsModuleTraceDependency & Record} StatsModuleTraceDependency */ /** * @typedef {Object} KnownStatsModuleTraceDependency * @property {string=} loc */ /** @typedef {KnownStatsError & Record} StatsError */ /** * @typedef {Object} KnownStatsError * @property {string} message * @property {string=} chunkName * @property {boolean=} chunkEntry * @property {boolean=} chunkInitial * @property {string=} file * @property {string=} moduleIdentifier * @property {string=} moduleName * @property {string=} loc * @property {string|number=} chunkId * @property {string|number=} moduleId * @property {StatsModuleTraceItem[]=} moduleTrace * @property {any=} details * @property {string=} stack */ /** @typedef {Asset & { type: string, related: PreprocessedAsset[] }} PreprocessedAsset */ /** * @template T * @template O * @typedef {Record void>} ExtractorsByOption */ /** * @typedef {Object} SimpleExtractors * @property {ExtractorsByOption} compilation * @property {ExtractorsByOption} asset * @property {ExtractorsByOption} asset$visible * @property {ExtractorsByOption<{ name: string, chunkGroup: ChunkGroup }, StatsChunkGroup>} chunkGroup * @property {ExtractorsByOption} module * @property {ExtractorsByOption} module$visible * @property {ExtractorsByOption} moduleIssuer * @property {ExtractorsByOption} profile * @property {ExtractorsByOption} moduleReason * @property {ExtractorsByOption} chunk * @property {ExtractorsByOption} chunkOrigin * @property {ExtractorsByOption} error * @property {ExtractorsByOption} warning * @property {ExtractorsByOption<{ origin: Module, module: Module }, StatsModuleTraceItem>} moduleTraceItem * @property {ExtractorsByOption} moduleTraceDependency */ /** * @template T * @template I * @param {Iterable} items items to select from * @param {function(T): Iterable} selector selector function to select values from item * @returns {I[]} array of values */ const uniqueArray = (items, selector) => { /** @type {Set} */ const set = new Set(); for (const item of items) { for (const i of selector(item)) { set.add(i); } } return Array.from(set); }; /** * @template T * @template I * @param {Iterable} items items to select from * @param {function(T): Iterable} selector selector function to select values from item * @param {Comparator} comparator comparator function * @returns {I[]} array of values */ const uniqueOrderedArray = (items, selector, comparator) => { return uniqueArray(items, selector).sort(comparator); }; /** @template T @template R @typedef {{ [P in keyof T]: R }} MappedValues */ /** * @template T * @template R * @param {T} obj object to be mapped * @param {function(T[keyof T], keyof T): R} fn mapping function * @returns {MappedValues} mapped object */ const mapObject = (obj, fn) => { const newObj = Object.create(null); for (const key of Object.keys(obj)) { newObj[key] = fn(obj[key], /** @type {keyof T} */ (key)); } return newObj; }; /** * @param {Compilation} compilation the compilation * @param {function(Compilation, string): any[]} getItems get items * @returns {number} total number */ const countWithChildren = (compilation, getItems) => { let count = getItems(compilation, "").length; for (const child of compilation.children) { count += countWithChildren(child, (c, type) => getItems(c, `.children[].compilation${type}`) ); } return count; }; /** @type {ExtractorsByOption} */ const EXTRACT_ERROR = { _: (object, error, context, { requestShortener }) => { // TODO webpack 6 disallow strings in the errors/warnings list if (typeof error === "string") { object.message = error; } else { if (error.chunk) { object.chunkName = error.chunk.name; object.chunkEntry = error.chunk.hasRuntime(); object.chunkInitial = error.chunk.canBeInitial(); } if (error.file) { object.file = error.file; } if (error.module) { object.moduleIdentifier = error.module.identifier(); object.moduleName = error.module.readableIdentifier(requestShortener); } if (error.loc) { object.loc = formatLocation(error.loc); } object.message = error.message; } }, ids: (object, error, { compilation: { chunkGraph } }) => { if (typeof error !== "string") { if (error.chunk) { object.chunkId = error.chunk.id; } if (error.module) { object.moduleId = chunkGraph.getModuleId(error.module); } } }, moduleTrace: (object, error, context, options, factory) => { if (typeof error !== "string" && error.module) { const { type, compilation: { moduleGraph } } = context; /** @type {Set} */ const visitedModules = new Set(); const moduleTrace = []; let current = error.module; while (current) { if (visitedModules.has(current)) break; // circular (technically impossible, but how knows) visitedModules.add(current); const origin = moduleGraph.getIssuer(current); if (!origin) break; moduleTrace.push({ origin, module: current }); current = origin; } object.moduleTrace = factory.create( `${type}.moduleTrace`, moduleTrace, context ); } }, errorDetails: ( object, error, { type, compilation, cachedGetErrors, cachedGetWarnings }, { errorDetails } ) => { if ( typeof error !== "string" && (errorDetails === true || (type.endsWith(".error") && cachedGetErrors(compilation).length < 3)) ) { object.details = error.details; } }, errorStack: (object, error) => { if (typeof error !== "string") { object.stack = error.stack; } } }; /** @type {SimpleExtractors} */ const SIMPLE_EXTRACTORS = { compilation: { _: (object, compilation, context, options) => { if (!context.makePathsRelative) { context.makePathsRelative = makePathsRelative.bindContextCache( compilation.compiler.context, compilation.compiler.root ); } if (!context.cachedGetErrors) { const map = new WeakMap(); context.cachedGetErrors = compilation => { return ( map.get(compilation) || (errors => (map.set(compilation, errors), errors))( compilation.getErrors() ) ); }; } if (!context.cachedGetWarnings) { const map = new WeakMap(); context.cachedGetWarnings = compilation => { return ( map.get(compilation) || (warnings => (map.set(compilation, warnings), warnings))( compilation.getWarnings() ) ); }; } if (compilation.name) { object.name = compilation.name; } if (compilation.needAdditionalPass) { object.needAdditionalPass = true; } const { logging, loggingDebug, loggingTrace } = options; if (logging || (loggingDebug && loggingDebug.length > 0)) { const util = __webpack_require__(31669); object.logging = {}; let acceptedTypes; let collapsedGroups = false; switch (logging) { default: acceptedTypes = new Set(); break; case "error": acceptedTypes = new Set([LogType.error]); break; case "warn": acceptedTypes = new Set([LogType.error, LogType.warn]); break; case "info": acceptedTypes = new Set([ LogType.error, LogType.warn, LogType.info ]); break; case "log": acceptedTypes = new Set([ LogType.error, LogType.warn, LogType.info, LogType.log, LogType.group, LogType.groupEnd, LogType.groupCollapsed, LogType.clear ]); break; case "verbose": acceptedTypes = new Set([ LogType.error, LogType.warn, LogType.info, LogType.log, LogType.group, LogType.groupEnd, LogType.groupCollapsed, LogType.profile, LogType.profileEnd, LogType.time, LogType.status, LogType.clear ]); collapsedGroups = true; break; } const cachedMakePathsRelative = makePathsRelative.bindContextCache( options.context, compilation.compiler.root ); let depthInCollapsedGroup = 0; for (const [origin, logEntries] of compilation.logging) { const debugMode = loggingDebug.some(fn => fn(origin)); if (logging === false && !debugMode) continue; /** @type {KnownStatsLoggingEntry[]} */ const groupStack = []; /** @type {KnownStatsLoggingEntry[]} */ const rootList = []; let currentList = rootList; let processedLogEntries = 0; for (const entry of logEntries) { let type = entry.type; if (!debugMode && !acceptedTypes.has(type)) continue; // Expand groups in verbose and debug modes if ( type === LogType.groupCollapsed && (debugMode || collapsedGroups) ) type = LogType.group; if (depthInCollapsedGroup === 0) { processedLogEntries++; } if (type === LogType.groupEnd) { groupStack.pop(); if (groupStack.length > 0) { currentList = groupStack[groupStack.length - 1].children; } else { currentList = rootList; } if (depthInCollapsedGroup > 0) depthInCollapsedGroup--; continue; } let message = undefined; if (entry.type === LogType.time) { message = `${entry.args[0]}: ${ entry.args[1] * 1000 + entry.args[2] / 1000000 } ms`; } else if (entry.args && entry.args.length > 0) { message = util.format(entry.args[0], ...entry.args.slice(1)); } /** @type {KnownStatsLoggingEntry} */ const newEntry = { ...entry, type, message, trace: loggingTrace ? entry.trace : undefined, children: type === LogType.group || type === LogType.groupCollapsed ? [] : undefined }; currentList.push(newEntry); if (newEntry.children) { groupStack.push(newEntry); currentList = newEntry.children; if (depthInCollapsedGroup > 0) { depthInCollapsedGroup++; } else if (type === LogType.groupCollapsed) { depthInCollapsedGroup = 1; } } } let name = cachedMakePathsRelative(origin).replace(/\|/g, " "); if (name in object.logging) { let i = 1; while (`${name}#${i}` in object.logging) { i++; } name = `${name}#${i}`; } object.logging[name] = { entries: rootList, filteredEntries: logEntries.length - processedLogEntries, debug: debugMode }; } } }, hash: (object, compilation) => { object.hash = compilation.hash; }, version: object => { object.version = __webpack_require__(87168)/* .version */ .i8; }, env: (object, compilation, context, { _env }) => { object.env = _env; }, timings: (object, compilation) => { object.time = compilation.endTime - compilation.startTime; }, builtAt: (object, compilation) => { object.builtAt = compilation.endTime; }, publicPath: (object, compilation) => { object.publicPath = compilation.getPath( compilation.outputOptions.publicPath ); }, outputPath: (object, compilation) => { object.outputPath = compilation.outputOptions.path; }, assets: (object, compilation, context, options, factory) => { const { type } = context; /** @type {Map} */ const compilationFileToChunks = new Map(); /** @type {Map} */ const compilationAuxiliaryFileToChunks = new Map(); for (const chunk of compilation.chunks) { for (const file of chunk.files) { let array = compilationFileToChunks.get(file); if (array === undefined) { array = []; compilationFileToChunks.set(file, array); } array.push(chunk); } for (const file of chunk.auxiliaryFiles) { let array = compilationAuxiliaryFileToChunks.get(file); if (array === undefined) { array = []; compilationAuxiliaryFileToChunks.set(file, array); } array.push(chunk); } } /** @type {Map} */ const assetMap = new Map(); /** @type {Set} */ const assets = new Set(); for (const asset of compilation.getAssets()) { /** @type {PreprocessedAsset} */ const item = { ...asset, type: "asset", related: undefined }; assets.add(item); assetMap.set(asset.name, item); } for (const item of assetMap.values()) { const related = item.info.related; if (!related) continue; for (const type of Object.keys(related)) { const relatedEntry = related[type]; const deps = Array.isArray(relatedEntry) ? relatedEntry : [relatedEntry]; for (const dep of deps) { const depItem = assetMap.get(dep); if (!depItem) continue; assets.delete(depItem); depItem.type = type; item.related = item.related || []; item.related.push(depItem); } } } object.assetsByChunkName = {}; for (const [file, chunks] of compilationFileToChunks) { for (const chunk of chunks) { const name = chunk.name; if (!name) continue; if ( !Object.prototype.hasOwnProperty.call( object.assetsByChunkName, name ) ) { object.assetsByChunkName[name] = []; } object.assetsByChunkName[name].push(file); } } const groupedAssets = factory.create( `${type}.assets`, Array.from(assets), { ...context, compilationFileToChunks, compilationAuxiliaryFileToChunks } ); const limited = spaceLimited(groupedAssets, options.assetsSpace); object.assets = limited.children; object.filteredAssets = limited.filteredChildren; }, chunks: (object, compilation, context, options, factory) => { const { type } = context; object.chunks = factory.create( `${type}.chunks`, Array.from(compilation.chunks), context ); }, modules: (object, compilation, context, options, factory) => { const { type } = context; const array = Array.from(compilation.modules); const groupedModules = factory.create(`${type}.modules`, array, context); const limited = spaceLimited(groupedModules, options.modulesSpace); object.modules = limited.children; object.filteredModules = limited.filteredChildren; }, entrypoints: ( object, compilation, context, { entrypoints, chunkGroups, chunkGroupAuxiliary, chunkGroupChildren }, factory ) => { const { type } = context; const array = Array.from(compilation.entrypoints, ([key, value]) => ({ name: key, chunkGroup: value })); if (entrypoints === "auto" && !chunkGroups) { if (array.length > 5) return; if ( !chunkGroupChildren && array.every(({ chunkGroup }) => { if (chunkGroup.chunks.length !== 1) return false; const chunk = chunkGroup.chunks[0]; return ( chunk.files.size === 1 && (!chunkGroupAuxiliary || chunk.auxiliaryFiles.size === 0) ); }) ) { return; } } object.entrypoints = factory.create( `${type}.entrypoints`, array, context ); }, chunkGroups: (object, compilation, context, options, factory) => { const { type } = context; const array = Array.from( compilation.namedChunkGroups, ([key, value]) => ({ name: key, chunkGroup: value }) ); object.namedChunkGroups = factory.create( `${type}.namedChunkGroups`, array, context ); }, errors: (object, compilation, context, options, factory) => { const { type, cachedGetErrors } = context; object.errors = factory.create( `${type}.errors`, cachedGetErrors(compilation), context ); }, errorsCount: (object, compilation, { cachedGetErrors }) => { object.errorsCount = countWithChildren(compilation, c => cachedGetErrors(c) ); }, warnings: (object, compilation, context, options, factory) => { const { type, cachedGetWarnings } = context; object.warnings = factory.create( `${type}.warnings`, cachedGetWarnings(compilation), context ); }, warningsCount: ( object, compilation, context, { warningsFilter }, factory ) => { const { type, cachedGetWarnings } = context; object.warningsCount = countWithChildren(compilation, (c, childType) => { if (!warningsFilter && warningsFilter.length === 0) return cachedGetWarnings(c); return factory .create(`${type}${childType}.warnings`, cachedGetWarnings(c), context) .filter(warning => { const warningString = Object.keys(warning) .map(key => `${warning[key]}`) .join("\n"); return !warningsFilter.some(filter => filter(warning, warningString) ); }); }); }, errorDetails: ( object, compilation, { cachedGetErrors, cachedGetWarnings }, { errorDetails, errors, warnings } ) => { if (errorDetails === "auto") { if (warnings) { const warnings = cachedGetWarnings(compilation); object.filteredWarningDetailsCount = warnings .map(e => typeof e !== "string" && e.details) .filter(Boolean).length; } if (errors) { const errors = cachedGetErrors(compilation); if (errors.length >= 3) { object.filteredErrorDetailsCount = errors .map(e => typeof e !== "string" && e.details) .filter(Boolean).length; } } } }, children: (object, compilation, context, options, factory) => { const { type } = context; object.children = factory.create( `${type}.children`, compilation.children, context ); } }, asset: { _: (object, asset, context, options, factory) => { const { compilation } = context; object.type = asset.type; object.name = asset.name; object.size = asset.source.size(); object.emitted = compilation.emittedAssets.has(asset.name); object.comparedForEmit = compilation.comparedForEmitAssets.has( asset.name ); const cached = !object.emitted && !object.comparedForEmit; object.cached = cached; object.info = asset.info; if (!cached || options.cachedAssets) { Object.assign( object, factory.create(`${context.type}$visible`, asset, context) ); } } }, asset$visible: { _: ( object, asset, { compilation, compilationFileToChunks, compilationAuxiliaryFileToChunks } ) => { const chunks = compilationFileToChunks.get(asset.name) || []; const auxiliaryChunks = compilationAuxiliaryFileToChunks.get(asset.name) || []; object.chunkNames = uniqueOrderedArray( chunks, c => (c.name ? [c.name] : []), compareIds ); object.chunkIdHints = uniqueOrderedArray( chunks, c => Array.from(c.idNameHints), compareIds ); object.auxiliaryChunkNames = uniqueOrderedArray( auxiliaryChunks, c => (c.name ? [c.name] : []), compareIds ); object.auxiliaryChunkIdHints = uniqueOrderedArray( auxiliaryChunks, c => Array.from(c.idNameHints), compareIds ); object.filteredRelated = asset.related ? asset.related.length : undefined; }, relatedAssets: (object, asset, context, options, factory) => { const { type } = context; object.related = factory.create( `${type.slice(0, -8)}.related`, asset.related, context ); object.filteredRelated = asset.related ? asset.related.length - object.related.length : undefined; }, ids: ( object, asset, { compilationFileToChunks, compilationAuxiliaryFileToChunks } ) => { const chunks = compilationFileToChunks.get(asset.name) || []; const auxiliaryChunks = compilationAuxiliaryFileToChunks.get(asset.name) || []; object.chunks = uniqueOrderedArray(chunks, c => c.ids, compareIds); object.auxiliaryChunks = uniqueOrderedArray( auxiliaryChunks, c => c.ids, compareIds ); }, performance: (object, asset) => { object.isOverSizeLimit = SizeLimitsPlugin.isOverSizeLimit(asset.source); } }, chunkGroup: { _: ( object, { name, chunkGroup }, { compilation, compilation: { moduleGraph, chunkGraph } }, { ids, chunkGroupAuxiliary, chunkGroupChildren, chunkGroupMaxAssets } ) => { const children = chunkGroupChildren && chunkGroup.getChildrenByOrders(moduleGraph, chunkGraph); /** * @param {string} name Name * @returns {{ name: string, size: number }} Asset object */ const toAsset = name => { const asset = compilation.getAsset(name); return { name, size: asset ? asset.info.size : -1 }; }; /** @type {(total: number, asset: { size: number }) => number} */ const sizeReducer = (total, { size }) => total + size; const assets = uniqueArray(chunkGroup.chunks, c => c.files).map(toAsset); const auxiliaryAssets = uniqueOrderedArray( chunkGroup.chunks, c => c.auxiliaryFiles, compareIds ).map(toAsset); const assetsSize = assets.reduce(sizeReducer, 0); const auxiliaryAssetsSize = auxiliaryAssets.reduce(sizeReducer, 0); /** @type {KnownStatsChunkGroup} */ const statsChunkGroup = { name, chunks: ids ? chunkGroup.chunks.map(c => c.id) : undefined, assets: assets.length <= chunkGroupMaxAssets ? assets : undefined, filteredAssets: assets.length <= chunkGroupMaxAssets ? 0 : assets.length, assetsSize, auxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets ? auxiliaryAssets : undefined, filteredAuxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets ? 0 : auxiliaryAssets.length, auxiliaryAssetsSize, children: children ? mapObject(children, groups => groups.map(group => { const assets = uniqueArray(group.chunks, c => c.files).map( toAsset ); const auxiliaryAssets = uniqueOrderedArray( group.chunks, c => c.auxiliaryFiles, compareIds ).map(toAsset); /** @type {KnownStatsChunkGroup} */ const childStatsChunkGroup = { name: group.name, chunks: ids ? group.chunks.map(c => c.id) : undefined, assets: assets.length <= chunkGroupMaxAssets ? assets : undefined, filteredAssets: assets.length <= chunkGroupMaxAssets ? 0 : assets.length, auxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets ? auxiliaryAssets : undefined, filteredAuxiliaryAssets: chunkGroupAuxiliary && auxiliaryAssets.length <= chunkGroupMaxAssets ? 0 : auxiliaryAssets.length }; return childStatsChunkGroup; }) ) : undefined, childAssets: children ? mapObject(children, groups => { /** @type {Set} */ const set = new Set(); for (const group of groups) { for (const chunk of group.chunks) { for (const asset of chunk.files) { set.add(asset); } } } return Array.from(set); }) : undefined }; Object.assign(object, statsChunkGroup); }, performance: (object, { chunkGroup }) => { object.isOverSizeLimit = SizeLimitsPlugin.isOverSizeLimit(chunkGroup); } }, module: { _: (object, module, context, options, factory) => { const { compilation, type } = context; const built = compilation.builtModules.has(module); const codeGenerated = compilation.codeGeneratedModules.has(module); const buildTimeExecuted = compilation.buildTimeExecutedModules.has(module); /** @type {{[x: string]: number}} */ const sizes = {}; for (const sourceType of module.getSourceTypes()) { sizes[sourceType] = module.size(sourceType); } /** @type {KnownStatsModule} */ const statsModule = { type: "module", moduleType: module.type, layer: module.layer, size: module.size(), sizes, built, codeGenerated, buildTimeExecuted, cached: !built && !codeGenerated }; Object.assign(object, statsModule); if (built || codeGenerated || options.cachedModules) { Object.assign( object, factory.create(`${type}$visible`, module, context) ); } } }, module$visible: { _: (object, module, context, { requestShortener }, factory) => { const { compilation, type, rootModules } = context; const { moduleGraph } = compilation; /** @type {Module[]} */ const path = []; const issuer = moduleGraph.getIssuer(module); let current = issuer; while (current) { path.push(current); current = moduleGraph.getIssuer(current); } path.reverse(); const profile = moduleGraph.getProfile(module); const errors = module.getErrors(); const errorsCount = errors !== undefined ? countIterable(errors) : 0; const warnings = module.getWarnings(); const warningsCount = warnings !== undefined ? countIterable(warnings) : 0; /** @type {{[x: string]: number}} */ const sizes = {}; for (const sourceType of module.getSourceTypes()) { sizes[sourceType] = module.size(sourceType); } /** @type {KnownStatsModule} */ const statsModule = { identifier: module.identifier(), name: module.readableIdentifier(requestShortener), nameForCondition: module.nameForCondition(), index: moduleGraph.getPreOrderIndex(module), preOrderIndex: moduleGraph.getPreOrderIndex(module), index2: moduleGraph.getPostOrderIndex(module), postOrderIndex: moduleGraph.getPostOrderIndex(module), cacheable: module.buildInfo.cacheable, optional: module.isOptional(moduleGraph), orphan: !type.endsWith("module.modules[].module$visible") && compilation.chunkGraph.getNumberOfModuleChunks(module) === 0, dependent: rootModules ? !rootModules.has(module) : undefined, issuer: issuer && issuer.identifier(), issuerName: issuer && issuer.readableIdentifier(requestShortener), issuerPath: issuer && factory.create(`${type.slice(0, -8)}.issuerPath`, path, context), failed: errorsCount > 0, errors: errorsCount, warnings: warningsCount }; Object.assign(object, statsModule); if (profile) { object.profile = factory.create( `${type.slice(0, -8)}.profile`, profile, context ); } }, ids: (object, module, { compilation: { chunkGraph, moduleGraph } }) => { object.id = chunkGraph.getModuleId(module); const issuer = moduleGraph.getIssuer(module); object.issuerId = issuer && chunkGraph.getModuleId(issuer); object.chunks = Array.from( chunkGraph.getOrderedModuleChunksIterable(module, compareChunksById), chunk => chunk.id ); }, moduleAssets: (object, module) => { object.assets = module.buildInfo.assets ? Object.keys(module.buildInfo.assets) : []; }, reasons: (object, module, context, options, factory) => { const { type, compilation: { moduleGraph } } = context; const groupsReasons = factory.create( `${type.slice(0, -8)}.reasons`, Array.from(moduleGraph.getIncomingConnections(module)), context ); const limited = spaceLimited(groupsReasons, options.reasonsSpace); object.reasons = limited.children; object.filteredReasons = limited.filteredChildren; }, usedExports: ( object, module, { runtime, compilation: { moduleGraph } } ) => { const usedExports = moduleGraph.getUsedExports(module, runtime); if (usedExports === null) { object.usedExports = null; } else if (typeof usedExports === "boolean") { object.usedExports = usedExports; } else { object.usedExports = Array.from(usedExports); } }, providedExports: (object, module, { compilation: { moduleGraph } }) => { const providedExports = moduleGraph.getProvidedExports(module); object.providedExports = Array.isArray(providedExports) ? providedExports : null; }, optimizationBailout: ( object, module, { compilation: { moduleGraph } }, { requestShortener } ) => { object.optimizationBailout = moduleGraph .getOptimizationBailout(module) .map(item => { if (typeof item === "function") return item(requestShortener); return item; }); }, depth: (object, module, { compilation: { moduleGraph } }) => { object.depth = moduleGraph.getDepth(module); }, nestedModules: (object, module, context, options, factory) => { const { type } = context; const innerModules = /** @type {Module & { modules?: Module[] }} */ ( module ).modules; if (Array.isArray(innerModules)) { const groupedModules = factory.create( `${type.slice(0, -8)}.modules`, innerModules, context ); const limited = spaceLimited( groupedModules, options.nestedModulesSpace ); object.modules = limited.children; object.filteredModules = limited.filteredChildren; } }, source: (object, module) => { const originalSource = module.originalSource(); if (originalSource) { object.source = originalSource.source(); } } }, profile: { _: (object, profile) => { /** @type {KnownStatsProfile} */ const statsProfile = { total: profile.factory + profile.restoring + profile.integration + profile.building + profile.storing, resolving: profile.factory, restoring: profile.restoring, building: profile.building, integration: profile.integration, storing: profile.storing, additionalResolving: profile.additionalFactories, additionalIntegration: profile.additionalIntegration, // TODO remove this in webpack 6 factory: profile.factory, // TODO remove this in webpack 6 dependencies: profile.additionalFactories }; Object.assign(object, statsProfile); } }, moduleIssuer: { _: (object, module, context, { requestShortener }, factory) => { const { compilation, type } = context; const { moduleGraph } = compilation; const profile = moduleGraph.getProfile(module); /** @type {KnownStatsModuleIssuer} */ const statsModuleIssuer = { identifier: module.identifier(), name: module.readableIdentifier(requestShortener) }; Object.assign(object, statsModuleIssuer); if (profile) { object.profile = factory.create(`${type}.profile`, profile, context); } }, ids: (object, module, { compilation: { chunkGraph } }) => { object.id = chunkGraph.getModuleId(module); } }, moduleReason: { _: (object, reason, { runtime }, { requestShortener }) => { const dep = reason.dependency; const moduleDep = dep && dep instanceof ModuleDependency ? dep : undefined; /** @type {KnownStatsModuleReason} */ const statsModuleReason = { moduleIdentifier: reason.originModule ? reason.originModule.identifier() : null, module: reason.originModule ? reason.originModule.readableIdentifier(requestShortener) : null, moduleName: reason.originModule ? reason.originModule.readableIdentifier(requestShortener) : null, resolvedModuleIdentifier: reason.resolvedOriginModule ? reason.resolvedOriginModule.identifier() : null, resolvedModule: reason.resolvedOriginModule ? reason.resolvedOriginModule.readableIdentifier(requestShortener) : null, type: reason.dependency ? reason.dependency.type : null, active: reason.isActive(runtime), explanation: reason.explanation, userRequest: (moduleDep && moduleDep.userRequest) || null }; Object.assign(object, statsModuleReason); if (reason.dependency) { const locInfo = formatLocation(reason.dependency.loc); if (locInfo) { object.loc = locInfo; } } }, ids: (object, reason, { compilation: { chunkGraph } }) => { object.moduleId = reason.originModule ? chunkGraph.getModuleId(reason.originModule) : null; object.resolvedModuleId = reason.resolvedOriginModule ? chunkGraph.getModuleId(reason.resolvedOriginModule) : null; } }, chunk: { _: (object, chunk, { makePathsRelative, compilation: { chunkGraph } }) => { const childIdByOrder = chunk.getChildIdsByOrders(chunkGraph); /** @type {KnownStatsChunk} */ const statsChunk = { rendered: chunk.rendered, initial: chunk.canBeInitial(), entry: chunk.hasRuntime(), recorded: AggressiveSplittingPlugin.wasChunkRecorded(chunk), reason: chunk.chunkReason, size: chunkGraph.getChunkModulesSize(chunk), sizes: chunkGraph.getChunkModulesSizes(chunk), names: chunk.name ? [chunk.name] : [], idHints: Array.from(chunk.idNameHints), runtime: chunk.runtime === undefined ? undefined : typeof chunk.runtime === "string" ? [makePathsRelative(chunk.runtime)] : Array.from(chunk.runtime.sort(), makePathsRelative), files: Array.from(chunk.files), auxiliaryFiles: Array.from(chunk.auxiliaryFiles).sort(compareIds), hash: chunk.renderedHash, childrenByOrder: childIdByOrder }; Object.assign(object, statsChunk); }, ids: (object, chunk) => { object.id = chunk.id; }, chunkRelations: (object, chunk, { compilation: { chunkGraph } }) => { /** @type {Set} */ const parents = new Set(); /** @type {Set} */ const children = new Set(); /** @type {Set} */ const siblings = new Set(); for (const chunkGroup of chunk.groupsIterable) { for (const parentGroup of chunkGroup.parentsIterable) { for (const chunk of parentGroup.chunks) { parents.add(chunk.id); } } for (const childGroup of chunkGroup.childrenIterable) { for (const chunk of childGroup.chunks) { children.add(chunk.id); } } for (const sibling of chunkGroup.chunks) { if (sibling !== chunk) siblings.add(sibling.id); } } object.siblings = Array.from(siblings).sort(compareIds); object.parents = Array.from(parents).sort(compareIds); object.children = Array.from(children).sort(compareIds); }, chunkModules: (object, chunk, context, options, factory) => { const { type, compilation: { chunkGraph } } = context; const array = chunkGraph.getChunkModules(chunk); const groupedModules = factory.create(`${type}.modules`, array, { ...context, runtime: chunk.runtime, rootModules: new Set(chunkGraph.getChunkRootModules(chunk)) }); const limited = spaceLimited(groupedModules, options.chunkModulesSpace); object.modules = limited.children; object.filteredModules = limited.filteredChildren; }, chunkOrigins: (object, chunk, context, options, factory) => { const { type, compilation: { chunkGraph } } = context; /** @type {Set} */ const originsKeySet = new Set(); const origins = []; for (const g of chunk.groupsIterable) { origins.push(...g.origins); } const array = origins.filter(origin => { const key = [ origin.module ? chunkGraph.getModuleId(origin.module) : undefined, formatLocation(origin.loc), origin.request ].join(); if (originsKeySet.has(key)) return false; originsKeySet.add(key); return true; }); object.origins = factory.create(`${type}.origins`, array, context); } }, chunkOrigin: { _: (object, origin, context, { requestShortener }) => { /** @type {KnownStatsChunkOrigin} */ const statsChunkOrigin = { module: origin.module ? origin.module.identifier() : "", moduleIdentifier: origin.module ? origin.module.identifier() : "", moduleName: origin.module ? origin.module.readableIdentifier(requestShortener) : "", loc: formatLocation(origin.loc), request: origin.request }; Object.assign(object, statsChunkOrigin); }, ids: (object, origin, { compilation: { chunkGraph } }) => { object.moduleId = origin.module ? chunkGraph.getModuleId(origin.module) : undefined; } }, error: EXTRACT_ERROR, warning: EXTRACT_ERROR, moduleTraceItem: { _: (object, { origin, module }, context, { requestShortener }, factory) => { const { type, compilation: { moduleGraph } } = context; object.originIdentifier = origin.identifier(); object.originName = origin.readableIdentifier(requestShortener); object.moduleIdentifier = module.identifier(); object.moduleName = module.readableIdentifier(requestShortener); const dependencies = Array.from( moduleGraph.getIncomingConnections(module) ) .filter(c => c.resolvedOriginModule === origin && c.dependency) .map(c => c.dependency); object.dependencies = factory.create( `${type}.dependencies`, Array.from(new Set(dependencies)), context ); }, ids: (object, { origin, module }, { compilation: { chunkGraph } }) => { object.originId = chunkGraph.getModuleId(origin); object.moduleId = chunkGraph.getModuleId(module); } }, moduleTraceDependency: { _: (object, dependency) => { object.loc = formatLocation(dependency.loc); } } }; /** @type {Record boolean | undefined>>} */ const FILTER = { "module.reasons": { "!orphanModules": (reason, { compilation: { chunkGraph } }) => { if ( reason.originModule && chunkGraph.getNumberOfModuleChunks(reason.originModule) === 0 ) { return false; } } } }; /** @type {Record boolean | undefined>>} */ const FILTER_RESULTS = { "compilation.warnings": { warningsFilter: util.deprecate( (warning, context, { warningsFilter }) => { const warningString = Object.keys(warning) .map(key => `${warning[key]}`) .join("\n"); return !warningsFilter.some(filter => filter(warning, warningString)); }, "config.stats.warningsFilter is deprecated in favor of config.ignoreWarnings", "DEP_WEBPACK_STATS_WARNINGS_FILTER" ) } }; /** @type {Record void>} */ const MODULES_SORTER = { _: (comparators, { compilation: { moduleGraph } }) => { comparators.push( compareSelect( /** * @param {Module} m module * @returns {number} depth */ m => moduleGraph.getDepth(m), compareNumbers ), compareSelect( /** * @param {Module} m module * @returns {number} index */ m => moduleGraph.getPreOrderIndex(m), compareNumbers ), compareSelect( /** * @param {Module} m module * @returns {string} identifier */ m => m.identifier(), compareIds ) ); } }; /** @type {Record void>>} */ const SORTERS = { "compilation.chunks": { _: comparators => { comparators.push(compareSelect(c => c.id, compareIds)); } }, "compilation.modules": MODULES_SORTER, "chunk.rootModules": MODULES_SORTER, "chunk.modules": MODULES_SORTER, "module.modules": MODULES_SORTER, "module.reasons": { _: (comparators, { compilation: { chunkGraph } }) => { comparators.push( compareSelect(x => x.originModule, compareModulesByIdentifier) ); comparators.push( compareSelect(x => x.resolvedOriginModule, compareModulesByIdentifier) ); comparators.push( compareSelect( x => x.dependency, concatComparators( compareSelect( /** * @param {Dependency} x dependency * @returns {DependencyLocation} location */ x => x.loc, compareLocations ), compareSelect(x => x.type, compareIds) ) ) ); } }, "chunk.origins": { _: (comparators, { compilation: { chunkGraph } }) => { comparators.push( compareSelect( origin => origin.module ? chunkGraph.getModuleId(origin.module) : undefined, compareIds ), compareSelect(origin => formatLocation(origin.loc), compareIds), compareSelect(origin => origin.request, compareIds) ); } } }; const getItemSize = item => { // Each item takes 1 line // + the size of the children // + 1 extra line when it has children and filteredChildren return !item.children ? 1 : item.filteredChildren ? 2 + getTotalSize(item.children) : 1 + getTotalSize(item.children); }; const getTotalSize = children => { let size = 0; for (const child of children) { size += getItemSize(child); } return size; }; const getTotalItems = children => { let count = 0; for (const child of children) { if (!child.children && !child.filteredChildren) { count++; } else { if (child.children) count += getTotalItems(child.children); if (child.filteredChildren) count += child.filteredChildren; } } return count; }; const collapse = children => { // After collapse each child must take exactly one line const newChildren = []; for (const child of children) { if (child.children) { let filteredChildren = child.filteredChildren || 0; filteredChildren += getTotalItems(child.children); newChildren.push({ ...child, children: undefined, filteredChildren }); } else { newChildren.push(child); } } return newChildren; }; const spaceLimited = (itemsAndGroups, max) => { /** @type {any[] | undefined} */ let children = undefined; /** @type {number | undefined} */ let filteredChildren = undefined; // This are the groups, which take 1+ lines each const groups = itemsAndGroups.filter(c => c.children || c.filteredChildren); // The sizes of the groups are stored in groupSizes const groupSizes = groups.map(g => getItemSize(g)); // This are the items, which take 1 line each const items = itemsAndGroups.filter(c => !c.children && !c.filteredChildren); // The total of group sizes let groupsSize = groupSizes.reduce((a, b) => a + b, 0); if (groupsSize + items.length <= max) { // The total size in the current state fits into the max // keep all children = groups.concat(items); } else if ( groups.length > 0 && groups.length + Math.min(1, items.length) < max ) { // If each group would take 1 line the total would be below the maximum // collapse some groups, keep items while (groupsSize + items.length + (filteredChildren ? 1 : 0) > max) { // calculate how much we are over the size limit // this allows to approach the limit faster // it's always > 1 const oversize = items.length + groupsSize + (filteredChildren ? 1 : 0) - max; // Find the maximum group and process only this one const maxGroupSize = Math.max(...groupSizes); if (maxGroupSize < items.length) { filteredChildren = items.length; items.length = 0; continue; } for (let i = 0; i < groups.length; i++) { if (groupSizes[i] === maxGroupSize) { const group = groups[i]; // run this algorithm recursively and limit the size of the children to // current size - oversize / number of groups // So it should always end up being smaller const headerSize = !group.children ? 0 : group.filteredChildren ? 2 : 1; const limited = spaceLimited( group.children, groupSizes[i] - headerSize - oversize / groups.length ); groups[i] = { ...group, children: limited.children, filteredChildren: (group.filteredChildren || 0) + limited.filteredChildren }; const newSize = getItemSize(groups[i]); groupsSize -= groupSizes[i] - newSize; groupSizes[i] = newSize; break; } } } children = groups.concat(items); } else if ( groups.length > 0 && groups.length + Math.min(1, items.length) <= max ) { // If we have only enough space to show one line per group and one line for the filtered items // collapse all groups and items children = groups.length ? collapse(groups) : undefined; filteredChildren = items.length; } else { // If we have no space // collapse complete group filteredChildren = getTotalItems(itemsAndGroups); } return { children, filteredChildren }; }; const assetGroup = (children, assets) => { let size = 0; for (const asset of children) { size += asset.size; } return { size }; }; const moduleGroup = (children, modules) => { let size = 0; const sizes = {}; for (const module of children) { size += module.size; for (const key of Object.keys(module.sizes)) { sizes[key] = (sizes[key] || 0) + module.sizes[key]; } } return { size, sizes }; }; const reasonGroup = (children, reasons) => { let active = false; for (const reason of children) { active = active || reason.active; } return { active }; }; /** @type {Record void>} */ const ASSETS_GROUPERS = { _: (groupConfigs, context, options) => { const groupByFlag = (name, exclude) => { groupConfigs.push({ getKeys: asset => { return asset[name] ? ["1"] : undefined; }, getOptions: () => { return { groupChildren: !exclude, force: exclude }; }, createGroup: (key, children, assets) => { return exclude ? { type: "assets by status", [name]: !!key, filteredChildren: assets.length, ...assetGroup(children, assets) } : { type: "assets by status", [name]: !!key, children, ...assetGroup(children, assets) }; } }); }; const { groupAssetsByEmitStatus, groupAssetsByPath, groupAssetsByExtension } = options; if (groupAssetsByEmitStatus) { groupByFlag("emitted"); groupByFlag("comparedForEmit"); groupByFlag("isOverSizeLimit"); } if (groupAssetsByEmitStatus || !options.cachedAssets) { groupByFlag("cached", !options.cachedAssets); } if (groupAssetsByPath || groupAssetsByExtension) { groupConfigs.push({ getKeys: asset => { const extensionMatch = groupAssetsByExtension && /(\.[^.]+)(?:\?.*|$)/.exec(asset.name); const extension = extensionMatch ? extensionMatch[1] : ""; const pathMatch = groupAssetsByPath && /(.+)[/\\][^/\\]+(?:\?.*|$)/.exec(asset.name); const path = pathMatch ? pathMatch[1].split(/[/\\]/) : []; const keys = []; if (groupAssetsByPath) { keys.push("."); if (extension) keys.push( path.length ? `${path.join("/")}/*${extension}` : `*${extension}` ); while (path.length > 0) { keys.push(path.join("/") + "/"); path.pop(); } } else { if (extension) keys.push(`*${extension}`); } return keys; }, createGroup: (key, children, assets) => { return { type: groupAssetsByPath ? "assets by path" : "assets by extension", name: key, children, ...assetGroup(children, assets) }; } }); } }, groupAssetsByInfo: (groupConfigs, context, options) => { const groupByAssetInfoFlag = name => { groupConfigs.push({ getKeys: asset => { return asset.info && asset.info[name] ? ["1"] : undefined; }, createGroup: (key, children, assets) => { return { type: "assets by info", info: { [name]: !!key }, children, ...assetGroup(children, assets) }; } }); }; groupByAssetInfoFlag("immutable"); groupByAssetInfoFlag("development"); groupByAssetInfoFlag("hotModuleReplacement"); }, groupAssetsByChunk: (groupConfigs, context, options) => { const groupByNames = name => { groupConfigs.push({ getKeys: asset => { return asset[name]; }, createGroup: (key, children, assets) => { return { type: "assets by chunk", [name]: [key], children, ...assetGroup(children, assets) }; } }); }; groupByNames("chunkNames"); groupByNames("auxiliaryChunkNames"); groupByNames("chunkIdHints"); groupByNames("auxiliaryChunkIdHints"); }, excludeAssets: (groupConfigs, context, { excludeAssets }) => { groupConfigs.push({ getKeys: asset => { const ident = asset.name; const excluded = excludeAssets.some(fn => fn(ident, asset)); if (excluded) return ["excluded"]; }, getOptions: () => ({ groupChildren: false, force: true }), createGroup: (key, children, assets) => ({ type: "hidden assets", filteredChildren: assets.length, ...assetGroup(children, assets) }) }); } }; /** @type {function("module" | "chunk" | "root-of-chunk" | "nested"): Record void>} */ const MODULES_GROUPERS = type => ({ _: (groupConfigs, context, options) => { const groupByFlag = (name, type, exclude) => { groupConfigs.push({ getKeys: module => { return module[name] ? ["1"] : undefined; }, getOptions: () => { return { groupChildren: !exclude, force: exclude }; }, createGroup: (key, children, modules) => { return { type, [name]: !!key, ...(exclude ? { filteredChildren: modules.length } : { children }), ...moduleGroup(children, modules) }; } }); }; const { groupModulesByCacheStatus, groupModulesByLayer, groupModulesByAttributes, groupModulesByType, groupModulesByPath, groupModulesByExtension } = options; if (groupModulesByAttributes) { groupByFlag("errors", "modules with errors"); groupByFlag("warnings", "modules with warnings"); groupByFlag("assets", "modules with assets"); groupByFlag("optional", "optional modules"); } if (groupModulesByCacheStatus) { groupByFlag("cacheable", "cacheable modules"); groupByFlag("built", "built modules"); groupByFlag("codeGenerated", "code generated modules"); } if (groupModulesByCacheStatus || !options.cachedModules) { groupByFlag("cached", "cached modules", !options.cachedModules); } if (groupModulesByAttributes || !options.orphanModules) { groupByFlag("orphan", "orphan modules", !options.orphanModules); } if (groupModulesByAttributes || !options.dependentModules) { groupByFlag("dependent", "dependent modules", !options.dependentModules); } if (groupModulesByType || !options.runtimeModules) { groupConfigs.push({ getKeys: module => { if (!module.moduleType) return; if (groupModulesByType) { return [module.moduleType.split("/", 1)[0]]; } else if (module.moduleType === "runtime") { return ["runtime"]; } }, getOptions: key => { const exclude = key === "runtime" && !options.runtimeModules; return { groupChildren: !exclude, force: exclude }; }, createGroup: (key, children, modules) => { const exclude = key === "runtime" && !options.runtimeModules; return { type: `${key} modules`, moduleType: key, ...(exclude ? { filteredChildren: modules.length } : { children }), ...moduleGroup(children, modules) }; } }); } if (groupModulesByLayer) { groupConfigs.push({ getKeys: module => { return [module.layer]; }, createGroup: (key, children, modules) => { return { type: "modules by layer", layer: key, children, ...moduleGroup(children, modules) }; } }); } if (groupModulesByPath || groupModulesByExtension) { groupConfigs.push({ getKeys: module => { if (!module.name) return; const resource = parseResource(module.name.split("!").pop()).path; const extensionMatch = groupModulesByExtension && /(\.[^.]+)(?:\?.*|$)/.exec(resource); const extension = extensionMatch ? extensionMatch[1] : ""; const pathMatch = groupModulesByPath && /(.+)[/\\][^/\\]+(?:\?.*|$)/.exec(resource); const path = pathMatch ? pathMatch[1].split(/[/\\]/) : []; const keys = []; if (groupModulesByPath) { if (extension) keys.push( path.length ? `${path.join("/")}/*${extension}` : `*${extension}` ); while (path.length > 0) { keys.push(path.join("/") + "/"); path.pop(); } } else { if (extension) keys.push(`*${extension}`); } return keys; }, createGroup: (key, children, modules) => { return { type: groupModulesByPath ? "modules by path" : "modules by extension", name: key, children, ...moduleGroup(children, modules) }; } }); } }, excludeModules: (groupConfigs, context, { excludeModules }) => { groupConfigs.push({ getKeys: module => { const name = module.name; if (name) { const excluded = excludeModules.some(fn => fn(name, module, type)); if (excluded) return ["1"]; } }, getOptions: () => ({ groupChildren: false, force: true }), createGroup: (key, children, modules) => ({ type: "hidden modules", filteredChildren: children.length, ...moduleGroup(children, modules) }) }); } }); /** @type {Record void>>} */ const RESULT_GROUPERS = { "compilation.assets": ASSETS_GROUPERS, "asset.related": ASSETS_GROUPERS, "compilation.modules": MODULES_GROUPERS("module"), "chunk.modules": MODULES_GROUPERS("chunk"), "chunk.rootModules": MODULES_GROUPERS("root-of-chunk"), "module.modules": MODULES_GROUPERS("nested"), "module.reasons": { groupReasonsByOrigin: groupConfigs => { groupConfigs.push({ getKeys: reason => { return [reason.module]; }, createGroup: (key, children, reasons) => { return { type: "from origin", module: key, children, ...reasonGroup(children, reasons) }; } }); } } }; // remove a prefixed "!" that can be specified to reverse sort order const normalizeFieldKey = field => { if (field[0] === "!") { return field.substr(1); } return field; }; // if a field is prefixed by a "!" reverse sort order const sortOrderRegular = field => { if (field[0] === "!") { return false; } return true; }; /** * @param {string} field field name * @returns {function(Object, Object): number} comparators */ const sortByField = field => { if (!field) { /** * @param {any} a first * @param {any} b second * @returns {-1|0|1} zero */ const noSort = (a, b) => 0; return noSort; } const fieldKey = normalizeFieldKey(field); let sortFn = compareSelect(m => m[fieldKey], compareIds); // if a field is prefixed with a "!" the sort is reversed! const sortIsRegular = sortOrderRegular(field); if (!sortIsRegular) { const oldSortFn = sortFn; sortFn = (a, b) => oldSortFn(b, a); } return sortFn; }; const ASSET_SORTERS = { /** @type {(comparators: Function[], context: StatsFactoryContext, options: NormalizedStatsOptions) => void} */ assetsSort: (comparators, context, { assetsSort }) => { comparators.push(sortByField(assetsSort)); }, _: comparators => { comparators.push(compareSelect(a => a.name, compareIds)); } }; /** @type {Record void>>} */ const RESULT_SORTERS = { "compilation.chunks": { chunksSort: (comparators, context, { chunksSort }) => { comparators.push(sortByField(chunksSort)); } }, "compilation.modules": { modulesSort: (comparators, context, { modulesSort }) => { comparators.push(sortByField(modulesSort)); } }, "chunk.modules": { chunkModulesSort: (comparators, context, { chunkModulesSort }) => { comparators.push(sortByField(chunkModulesSort)); } }, "module.modules": { nestedModulesSort: (comparators, context, { nestedModulesSort }) => { comparators.push(sortByField(nestedModulesSort)); } }, "compilation.assets": ASSET_SORTERS, "asset.related": ASSET_SORTERS }; /** * @param {Record>} config the config see above * @param {NormalizedStatsOptions} options stats options * @param {function(string, Function): void} fn handler function called for every active line in config * @returns {void} */ const iterateConfig = (config, options, fn) => { for (const hookFor of Object.keys(config)) { const subConfig = config[hookFor]; for (const option of Object.keys(subConfig)) { if (option !== "_") { if (option.startsWith("!")) { if (options[option.slice(1)]) continue; } else { const value = options[option]; if ( value === false || value === undefined || (Array.isArray(value) && value.length === 0) ) continue; } } fn(hookFor, subConfig[option]); } } }; /** @type {Record} */ const ITEM_NAMES = { "compilation.children[]": "compilation", "compilation.modules[]": "module", "compilation.entrypoints[]": "chunkGroup", "compilation.namedChunkGroups[]": "chunkGroup", "compilation.errors[]": "error", "compilation.warnings[]": "warning", "chunk.modules[]": "module", "chunk.rootModules[]": "module", "chunk.origins[]": "chunkOrigin", "compilation.chunks[]": "chunk", "compilation.assets[]": "asset", "asset.related[]": "asset", "module.issuerPath[]": "moduleIssuer", "module.reasons[]": "moduleReason", "module.modules[]": "module", "module.children[]": "module", "moduleTrace[]": "moduleTraceItem", "moduleTraceItem.dependencies[]": "moduleTraceDependency" }; /** * @param {Object[]} items items to be merged * @returns {Object} an object */ const mergeToObject = items => { const obj = Object.create(null); for (const item of items) { obj[item.name] = item; } return obj; }; /** @type {Record any>} */ const MERGER = { "compilation.entrypoints": mergeToObject, "compilation.namedChunkGroups": mergeToObject }; class DefaultStatsFactoryPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap("DefaultStatsFactoryPlugin", compilation => { compilation.hooks.statsFactory.tap( "DefaultStatsFactoryPlugin", (stats, options, context) => { iterateConfig(SIMPLE_EXTRACTORS, options, (hookFor, fn) => { stats.hooks.extract .for(hookFor) .tap("DefaultStatsFactoryPlugin", (obj, data, ctx) => fn(obj, data, ctx, options, stats) ); }); iterateConfig(FILTER, options, (hookFor, fn) => { stats.hooks.filter .for(hookFor) .tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i) => fn(item, ctx, options, idx, i) ); }); iterateConfig(FILTER_RESULTS, options, (hookFor, fn) => { stats.hooks.filterResults .for(hookFor) .tap("DefaultStatsFactoryPlugin", (item, ctx, idx, i) => fn(item, ctx, options, idx, i) ); }); iterateConfig(SORTERS, options, (hookFor, fn) => { stats.hooks.sort .for(hookFor) .tap("DefaultStatsFactoryPlugin", (comparators, ctx) => fn(comparators, ctx, options) ); }); iterateConfig(RESULT_SORTERS, options, (hookFor, fn) => { stats.hooks.sortResults .for(hookFor) .tap("DefaultStatsFactoryPlugin", (comparators, ctx) => fn(comparators, ctx, options) ); }); iterateConfig(RESULT_GROUPERS, options, (hookFor, fn) => { stats.hooks.groupResults .for(hookFor) .tap("DefaultStatsFactoryPlugin", (groupConfigs, ctx) => fn(groupConfigs, ctx, options) ); }); for (const key of Object.keys(ITEM_NAMES)) { const itemName = ITEM_NAMES[key]; stats.hooks.getItemName .for(key) .tap("DefaultStatsFactoryPlugin", () => itemName); } for (const key of Object.keys(MERGER)) { const merger = MERGER[key]; stats.hooks.merge.for(key).tap("DefaultStatsFactoryPlugin", merger); } if (options.children) { if (Array.isArray(options.children)) { stats.hooks.getItemFactory .for("compilation.children[].compilation") .tap("DefaultStatsFactoryPlugin", (comp, { _index: idx }) => { if (idx < options.children.length) { return compilation.createStatsFactory( compilation.createStatsOptions( options.children[idx], context ) ); } }); } else if (options.children !== true) { const childFactory = compilation.createStatsFactory( compilation.createStatsOptions(options.children, context) ); stats.hooks.getItemFactory .for("compilation.children[].compilation") .tap("DefaultStatsFactoryPlugin", () => { return childFactory; }); } } } ); }); } } module.exports = DefaultStatsFactoryPlugin; /***/ }), /***/ 2130: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RequestShortener = __webpack_require__(43157); /** @typedef {import("../../declarations/WebpackOptions").StatsOptions} StatsOptions */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compilation").CreateStatsOptionsContext} CreateStatsOptionsContext */ /** @typedef {import("../Compiler")} Compiler */ const applyDefaults = (options, defaults) => { for (const key of Object.keys(defaults)) { if (typeof options[key] === "undefined") { options[key] = defaults[key]; } } }; const NAMED_PRESETS = { verbose: { hash: true, builtAt: true, relatedAssets: true, entrypoints: true, chunkGroups: true, ids: true, modules: false, chunks: true, chunkRelations: true, chunkModules: true, dependentModules: true, chunkOrigins: true, depth: true, env: true, reasons: true, usedExports: true, providedExports: true, optimizationBailout: true, errorDetails: true, errorStack: true, publicPath: true, logging: "verbose", orphanModules: true, runtimeModules: true, exclude: false, modulesSpace: Infinity, chunkModulesSpace: Infinity, assetsSpace: Infinity, reasonsSpace: Infinity, children: true }, detailed: { hash: true, builtAt: true, relatedAssets: true, entrypoints: true, chunkGroups: true, ids: true, chunks: true, chunkRelations: true, chunkModules: false, chunkOrigins: true, depth: true, usedExports: true, providedExports: true, optimizationBailout: true, errorDetails: true, publicPath: true, logging: true, runtimeModules: true, exclude: false, modulesSpace: 1000, assetsSpace: 1000, reasonsSpace: 1000 }, minimal: { all: false, version: true, timings: true, modules: true, modulesSpace: 0, assets: true, assetsSpace: 0, errors: true, errorsCount: true, warnings: true, warningsCount: true, logging: "warn" }, "errors-only": { all: false, errors: true, errorsCount: true, moduleTrace: true, logging: "error" }, "errors-warnings": { all: false, errors: true, errorsCount: true, warnings: true, warningsCount: true, logging: "warn" }, summary: { all: false, version: true, errorsCount: true, warningsCount: true }, none: { all: false } }; const NORMAL_ON = ({ all }) => all !== false; const NORMAL_OFF = ({ all }) => all === true; const ON_FOR_TO_STRING = ({ all }, { forToString }) => forToString ? all !== false : all === true; const OFF_FOR_TO_STRING = ({ all }, { forToString }) => forToString ? all === true : all !== false; const AUTO_FOR_TO_STRING = ({ all }, { forToString }) => { if (all === false) return false; if (all === true) return true; if (forToString) return "auto"; return true; }; /** @type {Record any>} */ const DEFAULTS = { context: (options, context, compilation) => compilation.compiler.context, requestShortener: (options, context, compilation) => compilation.compiler.context === options.context ? compilation.requestShortener : new RequestShortener(options.context, compilation.compiler.root), performance: NORMAL_ON, hash: OFF_FOR_TO_STRING, env: NORMAL_OFF, version: NORMAL_ON, timings: NORMAL_ON, builtAt: OFF_FOR_TO_STRING, assets: NORMAL_ON, entrypoints: AUTO_FOR_TO_STRING, chunkGroups: OFF_FOR_TO_STRING, chunkGroupAuxiliary: OFF_FOR_TO_STRING, chunkGroupChildren: OFF_FOR_TO_STRING, chunkGroupMaxAssets: (o, { forToString }) => (forToString ? 5 : Infinity), chunks: OFF_FOR_TO_STRING, chunkRelations: OFF_FOR_TO_STRING, chunkModules: ({ all, modules }) => { if (all === false) return false; if (all === true) return true; if (modules) return false; return true; }, dependentModules: OFF_FOR_TO_STRING, chunkOrigins: OFF_FOR_TO_STRING, ids: OFF_FOR_TO_STRING, modules: ({ all, chunks, chunkModules }, { forToString }) => { if (all === false) return false; if (all === true) return true; if (forToString && chunks && chunkModules) return false; return true; }, nestedModules: OFF_FOR_TO_STRING, groupModulesByType: ON_FOR_TO_STRING, groupModulesByCacheStatus: ON_FOR_TO_STRING, groupModulesByLayer: ON_FOR_TO_STRING, groupModulesByAttributes: ON_FOR_TO_STRING, groupModulesByPath: ON_FOR_TO_STRING, groupModulesByExtension: ON_FOR_TO_STRING, modulesSpace: (o, { forToString }) => (forToString ? 15 : Infinity), chunkModulesSpace: (o, { forToString }) => (forToString ? 10 : Infinity), nestedModulesSpace: (o, { forToString }) => (forToString ? 10 : Infinity), relatedAssets: OFF_FOR_TO_STRING, groupAssetsByEmitStatus: ON_FOR_TO_STRING, groupAssetsByInfo: ON_FOR_TO_STRING, groupAssetsByPath: ON_FOR_TO_STRING, groupAssetsByExtension: ON_FOR_TO_STRING, groupAssetsByChunk: ON_FOR_TO_STRING, assetsSpace: (o, { forToString }) => (forToString ? 15 : Infinity), orphanModules: OFF_FOR_TO_STRING, runtimeModules: ({ all, runtime }, { forToString }) => runtime !== undefined ? runtime : forToString ? all === true : all !== false, cachedModules: ({ all, cached }, { forToString }) => cached !== undefined ? cached : forToString ? all === true : all !== false, moduleAssets: OFF_FOR_TO_STRING, depth: OFF_FOR_TO_STRING, cachedAssets: OFF_FOR_TO_STRING, reasons: OFF_FOR_TO_STRING, reasonsSpace: (o, { forToString }) => (forToString ? 15 : Infinity), groupReasonsByOrigin: ON_FOR_TO_STRING, usedExports: OFF_FOR_TO_STRING, providedExports: OFF_FOR_TO_STRING, optimizationBailout: OFF_FOR_TO_STRING, children: OFF_FOR_TO_STRING, source: NORMAL_OFF, moduleTrace: NORMAL_ON, errors: NORMAL_ON, errorsCount: NORMAL_ON, errorDetails: AUTO_FOR_TO_STRING, errorStack: OFF_FOR_TO_STRING, warnings: NORMAL_ON, warningsCount: NORMAL_ON, publicPath: OFF_FOR_TO_STRING, logging: ({ all }, { forToString }) => forToString && all !== false ? "info" : false, loggingDebug: () => [], loggingTrace: OFF_FOR_TO_STRING, excludeModules: () => [], excludeAssets: () => [], modulesSort: () => "depth", chunkModulesSort: () => "name", nestedModulesSort: () => false, chunksSort: () => false, assetsSort: () => "!size", outputPath: OFF_FOR_TO_STRING, colors: () => false }; const normalizeFilter = item => { if (typeof item === "string") { const regExp = new RegExp( `[\\\\/]${item.replace( // eslint-disable-next-line no-useless-escape /[-[\]{}()*+?.\\^$|]/g, "\\$&" )}([\\\\/]|$|!|\\?)` ); return ident => regExp.test(ident); } if (item && typeof item === "object" && typeof item.test === "function") { return ident => item.test(ident); } if (typeof item === "function") { return item; } if (typeof item === "boolean") { return () => item; } }; const NORMALIZER = { excludeModules: value => { if (!Array.isArray(value)) { value = value ? [value] : []; } return value.map(normalizeFilter); }, excludeAssets: value => { if (!Array.isArray(value)) { value = value ? [value] : []; } return value.map(normalizeFilter); }, warningsFilter: value => { if (!Array.isArray(value)) { value = value ? [value] : []; } return value.map(filter => { if (typeof filter === "string") { return (warning, warningString) => warningString.includes(filter); } if (filter instanceof RegExp) { return (warning, warningString) => filter.test(warningString); } if (typeof filter === "function") { return filter; } throw new Error( `Can only filter warnings with Strings or RegExps. (Given: ${filter})` ); }); }, logging: value => { if (value === true) value = "log"; return value; }, loggingDebug: value => { if (!Array.isArray(value)) { value = value ? [value] : []; } return value.map(normalizeFilter); } }; class DefaultStatsPresetPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap("DefaultStatsPresetPlugin", compilation => { for (const key of Object.keys(NAMED_PRESETS)) { const defaults = NAMED_PRESETS[key]; compilation.hooks.statsPreset .for(key) .tap("DefaultStatsPresetPlugin", (options, context) => { applyDefaults(options, defaults); }); } compilation.hooks.statsNormalize.tap( "DefaultStatsPresetPlugin", (options, context) => { for (const key of Object.keys(DEFAULTS)) { if (options[key] === undefined) options[key] = DEFAULTS[key](options, context, compilation); } for (const key of Object.keys(NORMALIZER)) { options[key] = NORMALIZER[key](options[key]); } } ); }); } } module.exports = DefaultStatsPresetPlugin; /***/ }), /***/ 78303: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("./StatsPrinter")} StatsPrinter */ /** @typedef {import("./StatsPrinter").StatsPrinterContext} StatsPrinterContext */ const plural = (n, singular, plural) => (n === 1 ? singular : plural); /** * @param {Record} sizes sizes by source type * @param {Object} options options * @param {(number) => string=} options.formatSize size formatter * @returns {string} text */ const printSizes = (sizes, { formatSize = n => `${n}` }) => { const keys = Object.keys(sizes); if (keys.length > 1) { return keys.map(key => `${formatSize(sizes[key])} (${key})`).join(" "); } else if (keys.length === 1) { return formatSize(sizes[keys[0]]); } }; const mapLines = (str, fn) => str.split("\n").map(fn).join("\n"); /** * @param {number} n a number * @returns {string} number as two digit string, leading 0 */ const twoDigit = n => (n >= 10 ? `${n}` : `0${n}`); const isValidId = id => { return typeof id === "number" || id; }; /** @type {Record string | void>} */ const SIMPLE_PRINTERS = { "compilation.summary!": ( _, { type, bold, green, red, yellow, formatDateTime, formatTime, compilation: { name, hash, version, time, builtAt, errorsCount, warningsCount } } ) => { const root = type === "compilation.summary!"; const warningsMessage = warningsCount > 0 ? yellow( `${warningsCount} ${plural(warningsCount, "warning", "warnings")}` ) : ""; const errorsMessage = errorsCount > 0 ? red(`${errorsCount} ${plural(errorsCount, "error", "errors")}`) : ""; const timeMessage = root && time ? ` in ${formatTime(time)}` : ""; const hashMessage = hash ? ` (${hash})` : ""; const builtAtMessage = root && builtAt ? `${formatDateTime(builtAt)}: ` : ""; const versionMessage = root && version ? `webpack ${version}` : ""; const nameMessage = root && name ? bold(name) : name ? `Child ${bold(name)}` : root ? "" : "Child"; const subjectMessage = nameMessage && versionMessage ? `${nameMessage} (${versionMessage})` : versionMessage || nameMessage || "webpack"; let statusMessage; if (errorsMessage && warningsMessage) { statusMessage = `compiled with ${errorsMessage} and ${warningsMessage}`; } else if (errorsMessage) { statusMessage = `compiled with ${errorsMessage}`; } else if (warningsMessage) { statusMessage = `compiled with ${warningsMessage}`; } else if (errorsCount === 0 && warningsCount === 0) { statusMessage = `compiled ${green("successfully")}`; } else { statusMessage = `compiled`; } if ( builtAtMessage || versionMessage || errorsMessage || warningsMessage || (errorsCount === 0 && warningsCount === 0) || timeMessage || hashMessage ) return `${builtAtMessage}${subjectMessage} ${statusMessage}${timeMessage}${hashMessage}`; }, "compilation.filteredWarningDetailsCount": count => count ? `${count} ${plural( count, "warning has", "warnings have" )} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.` : undefined, "compilation.filteredErrorDetailsCount": (count, { yellow }) => count ? yellow( `${count} ${plural( count, "error has", "errors have" )} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.` ) : undefined, "compilation.env": (env, { bold }) => env ? `Environment (--env): ${bold(JSON.stringify(env, null, 2))}` : undefined, "compilation.publicPath": (publicPath, { bold }) => `PublicPath: ${bold(publicPath || "(none)")}`, "compilation.entrypoints": (entrypoints, context, printer) => Array.isArray(entrypoints) ? undefined : printer.print(context.type, Object.values(entrypoints), { ...context, chunkGroupKind: "Entrypoint" }), "compilation.namedChunkGroups": (namedChunkGroups, context, printer) => { if (!Array.isArray(namedChunkGroups)) { const { compilation: { entrypoints } } = context; let chunkGroups = Object.values(namedChunkGroups); if (entrypoints) { chunkGroups = chunkGroups.filter( group => !Object.prototype.hasOwnProperty.call(entrypoints, group.name) ); } return printer.print(context.type, chunkGroups, { ...context, chunkGroupKind: "Chunk Group" }); } }, "compilation.assetsByChunkName": () => "", "compilation.filteredModules": filteredModules => filteredModules > 0 ? `${filteredModules} ${plural(filteredModules, "module", "modules")}` : undefined, "compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) => filteredAssets > 0 ? `${filteredAssets} ${plural(filteredAssets, "asset", "assets")}` : undefined, "compilation.logging": (logging, context, printer) => Array.isArray(logging) ? undefined : printer.print( context.type, Object.entries(logging).map(([name, value]) => ({ ...value, name })), context ), "compilation.warningsInChildren!": (_, { yellow, compilation }) => { if ( !compilation.children && compilation.warningsCount > 0 && compilation.warnings ) { const childWarnings = compilation.warningsCount - compilation.warnings.length; if (childWarnings > 0) { return yellow( `${childWarnings} ${plural( childWarnings, "WARNING", "WARNINGS" )} in child compilations${ compilation.children ? "" : " (Use 'stats.children: true' resp. '--stats-children' for more details)" }` ); } } }, "compilation.errorsInChildren!": (_, { red, compilation }) => { if ( !compilation.children && compilation.errorsCount > 0 && compilation.errors ) { const childErrors = compilation.errorsCount - compilation.errors.length; if (childErrors > 0) { return red( `${childErrors} ${plural( childErrors, "ERROR", "ERRORS" )} in child compilations${ compilation.children ? "" : " (Use 'stats.children: true' resp. '--stats-children' for more details)" }` ); } } }, "asset.type": type => type, "asset.name": (name, { formatFilename, asset: { isOverSizeLimit } }) => formatFilename(name, isOverSizeLimit), "asset.size": ( size, { asset: { isOverSizeLimit }, yellow, green, formatSize } ) => (isOverSizeLimit ? yellow(formatSize(size)) : formatSize(size)), "asset.emitted": (emitted, { green, formatFlag }) => emitted ? green(formatFlag("emitted")) : undefined, "asset.comparedForEmit": (comparedForEmit, { yellow, formatFlag }) => comparedForEmit ? yellow(formatFlag("compared for emit")) : undefined, "asset.cached": (cached, { green, formatFlag }) => cached ? green(formatFlag("cached")) : undefined, "asset.isOverSizeLimit": (isOverSizeLimit, { yellow, formatFlag }) => isOverSizeLimit ? yellow(formatFlag("big")) : undefined, "asset.info.immutable": (immutable, { green, formatFlag }) => immutable ? green(formatFlag("immutable")) : undefined, "asset.info.javascriptModule": (javascriptModule, { formatFlag }) => javascriptModule ? formatFlag("javascript module") : undefined, "asset.info.sourceFilename": (sourceFilename, { formatFlag }) => sourceFilename ? formatFlag( sourceFilename === true ? "from source file" : `from: ${sourceFilename}` ) : undefined, "asset.info.development": (development, { green, formatFlag }) => development ? green(formatFlag("dev")) : undefined, "asset.info.hotModuleReplacement": ( hotModuleReplacement, { green, formatFlag } ) => (hotModuleReplacement ? green(formatFlag("hmr")) : undefined), "asset.separator!": () => "\n", "asset.filteredRelated": (filteredRelated, { asset: { related } }) => filteredRelated > 0 ? `${filteredRelated} related ${plural( filteredRelated, "asset", "assets" )}` : undefined, "asset.filteredChildren": filteredChildren => filteredChildren > 0 ? `${filteredChildren} ${plural(filteredChildren, "asset", "assets")}` : undefined, assetChunk: (id, { formatChunkId }) => formatChunkId(id), assetChunkName: name => name, assetChunkIdHint: name => name, "module.type": type => (type !== "module" ? type : undefined), "module.id": (id, { formatModuleId }) => isValidId(id) ? formatModuleId(id) : undefined, "module.name": (name, { bold }) => { const [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(name); return (prefix || "") + bold(resource); }, "module.identifier": identifier => undefined, "module.layer": (layer, { formatLayer }) => layer ? formatLayer(layer) : undefined, "module.sizes": printSizes, "module.chunks[]": (id, { formatChunkId }) => formatChunkId(id), "module.depth": (depth, { formatFlag }) => depth !== null ? formatFlag(`depth ${depth}`) : undefined, "module.cacheable": (cacheable, { formatFlag, red }) => cacheable === false ? red(formatFlag("not cacheable")) : undefined, "module.orphan": (orphan, { formatFlag, yellow }) => orphan ? yellow(formatFlag("orphan")) : undefined, "module.runtime": (runtime, { formatFlag, yellow }) => runtime ? yellow(formatFlag("runtime")) : undefined, "module.optional": (optional, { formatFlag, yellow }) => optional ? yellow(formatFlag("optional")) : undefined, "module.dependent": (dependent, { formatFlag, cyan }) => dependent ? cyan(formatFlag("dependent")) : undefined, "module.built": (built, { formatFlag, yellow }) => built ? yellow(formatFlag("built")) : undefined, "module.codeGenerated": (codeGenerated, { formatFlag, yellow }) => codeGenerated ? yellow(formatFlag("code generated")) : undefined, "module.buildTimeExecuted": (buildTimeExecuted, { formatFlag, green }) => buildTimeExecuted ? green(formatFlag("build time executed")) : undefined, "module.cached": (cached, { formatFlag, green }) => cached ? green(formatFlag("cached")) : undefined, "module.assets": (assets, { formatFlag, magenta }) => assets && assets.length ? magenta( formatFlag( `${assets.length} ${plural(assets.length, "asset", "assets")}` ) ) : undefined, "module.warnings": (warnings, { formatFlag, yellow }) => warnings === true ? yellow(formatFlag("warnings")) : warnings ? yellow( formatFlag(`${warnings} ${plural(warnings, "warning", "warnings")}`) ) : undefined, "module.errors": (errors, { formatFlag, red }) => errors === true ? red(formatFlag("errors")) : errors ? red(formatFlag(`${errors} ${plural(errors, "error", "errors")}`)) : undefined, "module.providedExports": (providedExports, { formatFlag, cyan }) => { if (Array.isArray(providedExports)) { if (providedExports.length === 0) return cyan(formatFlag("no exports")); return cyan(formatFlag(`exports: ${providedExports.join(", ")}`)); } }, "module.usedExports": (usedExports, { formatFlag, cyan, module }) => { if (usedExports !== true) { if (usedExports === null) return cyan(formatFlag("used exports unknown")); if (usedExports === false) return cyan(formatFlag("module unused")); if (Array.isArray(usedExports)) { if (usedExports.length === 0) return cyan(formatFlag("no exports used")); const providedExportsCount = Array.isArray(module.providedExports) ? module.providedExports.length : null; if ( providedExportsCount !== null && providedExportsCount === usedExports.length ) { return cyan(formatFlag("all exports used")); } else { return cyan( formatFlag(`only some exports used: ${usedExports.join(", ")}`) ); } } } }, "module.optimizationBailout[]": (optimizationBailout, { yellow }) => yellow(optimizationBailout), "module.issuerPath": (issuerPath, { module }) => module.profile ? undefined : "", "module.profile": profile => undefined, "module.filteredModules": filteredModules => filteredModules > 0 ? `${filteredModules} nested ${plural( filteredModules, "module", "modules" )}` : undefined, "module.filteredReasons": filteredReasons => filteredReasons > 0 ? `${filteredReasons} ${plural(filteredReasons, "reason", "reasons")}` : undefined, "module.filteredChildren": filteredChildren => filteredChildren > 0 ? `${filteredChildren} ${plural(filteredChildren, "module", "modules")}` : undefined, "module.separator!": () => "\n", "moduleIssuer.id": (id, { formatModuleId }) => formatModuleId(id), "moduleIssuer.profile.total": (value, { formatTime }) => formatTime(value), "moduleReason.type": type => type, "moduleReason.userRequest": (userRequest, { cyan }) => cyan(userRequest), "moduleReason.moduleId": (moduleId, { formatModuleId }) => isValidId(moduleId) ? formatModuleId(moduleId) : undefined, "moduleReason.module": (module, { magenta }) => magenta(module), "moduleReason.loc": loc => loc, "moduleReason.explanation": (explanation, { cyan }) => cyan(explanation), "moduleReason.active": (active, { formatFlag }) => active ? undefined : formatFlag("inactive"), "moduleReason.resolvedModule": (module, { magenta }) => magenta(module), "moduleReason.filteredChildren": filteredChildren => filteredChildren > 0 ? `${filteredChildren} ${plural(filteredChildren, "reason", "reasons")}` : undefined, "module.profile.total": (value, { formatTime }) => formatTime(value), "module.profile.resolving": (value, { formatTime }) => `resolving: ${formatTime(value)}`, "module.profile.restoring": (value, { formatTime }) => `restoring: ${formatTime(value)}`, "module.profile.integration": (value, { formatTime }) => `integration: ${formatTime(value)}`, "module.profile.building": (value, { formatTime }) => `building: ${formatTime(value)}`, "module.profile.storing": (value, { formatTime }) => `storing: ${formatTime(value)}`, "module.profile.additionalResolving": (value, { formatTime }) => value ? `additional resolving: ${formatTime(value)}` : undefined, "module.profile.additionalIntegration": (value, { formatTime }) => value ? `additional integration: ${formatTime(value)}` : undefined, "chunkGroup.kind!": (_, { chunkGroupKind }) => chunkGroupKind, "chunkGroup.separator!": () => "\n", "chunkGroup.name": (name, { bold }) => bold(name), "chunkGroup.isOverSizeLimit": (isOverSizeLimit, { formatFlag, yellow }) => isOverSizeLimit ? yellow(formatFlag("big")) : undefined, "chunkGroup.assetsSize": (size, { formatSize }) => size ? formatSize(size) : undefined, "chunkGroup.auxiliaryAssetsSize": (size, { formatSize }) => size ? `(${formatSize(size)})` : undefined, "chunkGroup.filteredAssets": n => n > 0 ? `${n} ${plural(n, "asset", "assets")}` : undefined, "chunkGroup.filteredAuxiliaryAssets": n => n > 0 ? `${n} auxiliary ${plural(n, "asset", "assets")}` : undefined, "chunkGroup.is!": () => "=", "chunkGroupAsset.name": (asset, { green }) => green(asset), "chunkGroupAsset.size": (size, { formatSize, chunkGroup }) => chunkGroup.assets.length > 1 || (chunkGroup.auxiliaryAssets && chunkGroup.auxiliaryAssets.length > 0) ? formatSize(size) : undefined, "chunkGroup.children": (children, context, printer) => Array.isArray(children) ? undefined : printer.print( context.type, Object.keys(children).map(key => ({ type: key, children: children[key] })), context ), "chunkGroupChildGroup.type": type => `${type}:`, "chunkGroupChild.assets[]": (file, { formatFilename }) => formatFilename(file), "chunkGroupChild.chunks[]": (id, { formatChunkId }) => formatChunkId(id), "chunkGroupChild.name": name => (name ? `(name: ${name})` : undefined), "chunk.id": (id, { formatChunkId }) => formatChunkId(id), "chunk.files[]": (file, { formatFilename }) => formatFilename(file), "chunk.names[]": name => name, "chunk.idHints[]": name => name, "chunk.runtime[]": name => name, "chunk.sizes": (sizes, context) => printSizes(sizes, context), "chunk.parents[]": (parents, context) => context.formatChunkId(parents, "parent"), "chunk.siblings[]": (siblings, context) => context.formatChunkId(siblings, "sibling"), "chunk.children[]": (children, context) => context.formatChunkId(children, "child"), "chunk.childrenByOrder": (childrenByOrder, context, printer) => Array.isArray(childrenByOrder) ? undefined : printer.print( context.type, Object.keys(childrenByOrder).map(key => ({ type: key, children: childrenByOrder[key] })), context ), "chunk.childrenByOrder[].type": type => `${type}:`, "chunk.childrenByOrder[].children[]": (id, { formatChunkId }) => isValidId(id) ? formatChunkId(id) : undefined, "chunk.entry": (entry, { formatFlag, yellow }) => entry ? yellow(formatFlag("entry")) : undefined, "chunk.initial": (initial, { formatFlag, yellow }) => initial ? yellow(formatFlag("initial")) : undefined, "chunk.rendered": (rendered, { formatFlag, green }) => rendered ? green(formatFlag("rendered")) : undefined, "chunk.recorded": (recorded, { formatFlag, green }) => recorded ? green(formatFlag("recorded")) : undefined, "chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined), "chunk.filteredModules": filteredModules => filteredModules > 0 ? `${filteredModules} chunk ${plural( filteredModules, "module", "modules" )}` : undefined, "chunk.separator!": () => "\n", "chunkOrigin.request": request => request, "chunkOrigin.moduleId": (moduleId, { formatModuleId }) => isValidId(moduleId) ? formatModuleId(moduleId) : undefined, "chunkOrigin.moduleName": (moduleName, { bold }) => bold(moduleName), "chunkOrigin.loc": loc => loc, "error.compilerPath": (compilerPath, { bold }) => compilerPath ? bold(`(${compilerPath})`) : undefined, "error.chunkId": (chunkId, { formatChunkId }) => isValidId(chunkId) ? formatChunkId(chunkId) : undefined, "error.chunkEntry": (chunkEntry, { formatFlag }) => chunkEntry ? formatFlag("entry") : undefined, "error.chunkInitial": (chunkInitial, { formatFlag }) => chunkInitial ? formatFlag("initial") : undefined, "error.file": (file, { bold }) => bold(file), "error.moduleName": (moduleName, { bold }) => { return moduleName.includes("!") ? `${bold(moduleName.replace(/^(\s|\S)*!/, ""))} (${moduleName})` : `${bold(moduleName)}`; }, "error.loc": (loc, { green }) => green(loc), "error.message": (message, { bold, formatError }) => message.includes("\u001b[") ? message : bold(formatError(message)), "error.details": (details, { formatError }) => formatError(details), "error.stack": stack => stack, "error.moduleTrace": moduleTrace => undefined, "error.separator!": () => "\n", "loggingEntry(error).loggingEntry.message": (message, { red }) => mapLines(message, x => ` ${red(x)}`), "loggingEntry(warn).loggingEntry.message": (message, { yellow }) => mapLines(message, x => ` ${yellow(x)}`), "loggingEntry(info).loggingEntry.message": (message, { green }) => mapLines(message, x => ` ${green(x)}`), "loggingEntry(log).loggingEntry.message": (message, { bold }) => mapLines(message, x => ` ${bold(x)}`), "loggingEntry(debug).loggingEntry.message": message => mapLines(message, x => ` ${x}`), "loggingEntry(trace).loggingEntry.message": message => mapLines(message, x => ` ${x}`), "loggingEntry(status).loggingEntry.message": (message, { magenta }) => mapLines(message, x => ` ${magenta(x)}`), "loggingEntry(profile).loggingEntry.message": (message, { magenta }) => mapLines(message, x => `

${magenta(x)}`), "loggingEntry(profileEnd).loggingEntry.message": (message, { magenta }) => mapLines(message, x => `

${magenta(x)}`), "loggingEntry(time).loggingEntry.message": (message, { magenta }) => mapLines(message, x => ` ${magenta(x)}`), "loggingEntry(group).loggingEntry.message": (message, { cyan }) => mapLines(message, x => `<-> ${cyan(x)}`), "loggingEntry(groupCollapsed).loggingEntry.message": (message, { cyan }) => mapLines(message, x => `<+> ${cyan(x)}`), "loggingEntry(clear).loggingEntry": () => " -------", "loggingEntry(groupCollapsed).loggingEntry.children": () => "", "loggingEntry.trace[]": trace => trace ? mapLines(trace, x => `| ${x}`) : undefined, "moduleTraceItem.originName": originName => originName, loggingGroup: loggingGroup => loggingGroup.entries.length === 0 ? "" : undefined, "loggingGroup.debug": (flag, { red }) => (flag ? red("DEBUG") : undefined), "loggingGroup.name": (name, { bold }) => bold(`LOG from ${name}`), "loggingGroup.separator!": () => "\n", "loggingGroup.filteredEntries": filteredEntries => filteredEntries > 0 ? `+ ${filteredEntries} hidden lines` : undefined, "moduleTraceDependency.loc": loc => loc }; /** @type {Record} */ const ITEM_NAMES = { "compilation.assets[]": "asset", "compilation.modules[]": "module", "compilation.chunks[]": "chunk", "compilation.entrypoints[]": "chunkGroup", "compilation.namedChunkGroups[]": "chunkGroup", "compilation.errors[]": "error", "compilation.warnings[]": "error", "compilation.logging[]": "loggingGroup", "compilation.children[]": "compilation", "asset.related[]": "asset", "asset.children[]": "asset", "asset.chunks[]": "assetChunk", "asset.auxiliaryChunks[]": "assetChunk", "asset.chunkNames[]": "assetChunkName", "asset.chunkIdHints[]": "assetChunkIdHint", "asset.auxiliaryChunkNames[]": "assetChunkName", "asset.auxiliaryChunkIdHints[]": "assetChunkIdHint", "chunkGroup.assets[]": "chunkGroupAsset", "chunkGroup.auxiliaryAssets[]": "chunkGroupAsset", "chunkGroupChild.assets[]": "chunkGroupAsset", "chunkGroupChild.auxiliaryAssets[]": "chunkGroupAsset", "chunkGroup.children[]": "chunkGroupChildGroup", "chunkGroupChildGroup.children[]": "chunkGroupChild", "module.modules[]": "module", "module.children[]": "module", "module.reasons[]": "moduleReason", "moduleReason.children[]": "moduleReason", "module.issuerPath[]": "moduleIssuer", "chunk.origins[]": "chunkOrigin", "chunk.modules[]": "module", "loggingGroup.entries[]": logEntry => `loggingEntry(${logEntry.type}).loggingEntry`, "loggingEntry.children[]": logEntry => `loggingEntry(${logEntry.type}).loggingEntry`, "error.moduleTrace[]": "moduleTraceItem", "moduleTraceItem.dependencies[]": "moduleTraceDependency" }; const ERROR_PREFERRED_ORDER = [ "compilerPath", "chunkId", "chunkEntry", "chunkInitial", "file", "separator!", "moduleName", "loc", "separator!", "message", "separator!", "details", "separator!", "stack", "separator!", "missing", "separator!", "moduleTrace" ]; /** @type {Record} */ const PREFERRED_ORDERS = { compilation: [ "name", "hash", "version", "time", "builtAt", "env", "publicPath", "assets", "filteredAssets", "entrypoints", "namedChunkGroups", "chunks", "modules", "filteredModules", "children", "logging", "warnings", "warningsInChildren!", "filteredWarningDetailsCount", "errors", "errorsInChildren!", "filteredErrorDetailsCount", "summary!", "needAdditionalPass" ], asset: [ "type", "name", "size", "chunks", "auxiliaryChunks", "emitted", "comparedForEmit", "cached", "info", "isOverSizeLimit", "chunkNames", "auxiliaryChunkNames", "chunkIdHints", "auxiliaryChunkIdHints", "related", "filteredRelated", "children", "filteredChildren" ], "asset.info": [ "immutable", "sourceFilename", "javascriptModule", "development", "hotModuleReplacement" ], chunkGroup: [ "kind!", "name", "isOverSizeLimit", "assetsSize", "auxiliaryAssetsSize", "is!", "assets", "filteredAssets", "auxiliaryAssets", "filteredAuxiliaryAssets", "separator!", "children" ], chunkGroupAsset: ["name", "size"], chunkGroupChildGroup: ["type", "children"], chunkGroupChild: ["assets", "chunks", "name"], module: [ "type", "name", "identifier", "id", "layer", "sizes", "chunks", "depth", "cacheable", "orphan", "runtime", "optional", "dependent", "built", "codeGenerated", "cached", "assets", "failed", "warnings", "errors", "children", "filteredChildren", "providedExports", "usedExports", "optimizationBailout", "reasons", "filteredReasons", "issuerPath", "profile", "modules", "filteredModules" ], moduleReason: [ "active", "type", "userRequest", "moduleId", "module", "resolvedModule", "loc", "explanation", "children", "filteredChildren" ], "module.profile": [ "total", "separator!", "resolving", "restoring", "integration", "building", "storing", "additionalResolving", "additionalIntegration" ], chunk: [ "id", "runtime", "files", "names", "idHints", "sizes", "parents", "siblings", "children", "childrenByOrder", "entry", "initial", "rendered", "recorded", "reason", "separator!", "origins", "separator!", "modules", "separator!", "filteredModules" ], chunkOrigin: ["request", "moduleId", "moduleName", "loc"], error: ERROR_PREFERRED_ORDER, warning: ERROR_PREFERRED_ORDER, "chunk.childrenByOrder[]": ["type", "children"], loggingGroup: [ "debug", "name", "separator!", "entries", "separator!", "filteredEntries" ], loggingEntry: ["message", "trace", "children"] }; const itemsJoinOneLine = items => items.filter(Boolean).join(" "); const itemsJoinOneLineBrackets = items => items.length > 0 ? `(${items.filter(Boolean).join(" ")})` : undefined; const itemsJoinMoreSpacing = items => items.filter(Boolean).join("\n\n"); const itemsJoinComma = items => items.filter(Boolean).join(", "); const itemsJoinCommaBrackets = items => items.length > 0 ? `(${items.filter(Boolean).join(", ")})` : undefined; const itemsJoinCommaBracketsWithName = name => items => items.length > 0 ? `(${name}: ${items.filter(Boolean).join(", ")})` : undefined; /** @type {Record string>} */ const SIMPLE_ITEMS_JOINER = { "chunk.parents": itemsJoinOneLine, "chunk.siblings": itemsJoinOneLine, "chunk.children": itemsJoinOneLine, "chunk.names": itemsJoinCommaBrackets, "chunk.idHints": itemsJoinCommaBracketsWithName("id hint"), "chunk.runtime": itemsJoinCommaBracketsWithName("runtime"), "chunk.files": itemsJoinComma, "chunk.childrenByOrder": itemsJoinOneLine, "chunk.childrenByOrder[].children": itemsJoinOneLine, "chunkGroup.assets": itemsJoinOneLine, "chunkGroup.auxiliaryAssets": itemsJoinOneLineBrackets, "chunkGroupChildGroup.children": itemsJoinComma, "chunkGroupChild.assets": itemsJoinOneLine, "chunkGroupChild.auxiliaryAssets": itemsJoinOneLineBrackets, "asset.chunks": itemsJoinComma, "asset.auxiliaryChunks": itemsJoinCommaBrackets, "asset.chunkNames": itemsJoinCommaBracketsWithName("name"), "asset.auxiliaryChunkNames": itemsJoinCommaBracketsWithName("auxiliary name"), "asset.chunkIdHints": itemsJoinCommaBracketsWithName("id hint"), "asset.auxiliaryChunkIdHints": itemsJoinCommaBracketsWithName("auxiliary id hint"), "module.chunks": itemsJoinOneLine, "module.issuerPath": items => items .filter(Boolean) .map(item => `${item} ->`) .join(" "), "compilation.errors": itemsJoinMoreSpacing, "compilation.warnings": itemsJoinMoreSpacing, "compilation.logging": itemsJoinMoreSpacing, "compilation.children": items => indent(itemsJoinMoreSpacing(items), " "), "moduleTraceItem.dependencies": itemsJoinOneLine, "loggingEntry.children": items => indent(items.filter(Boolean).join("\n"), " ", false) }; const joinOneLine = items => items .map(item => item.content) .filter(Boolean) .join(" "); const joinInBrackets = items => { const res = []; let mode = 0; for (const item of items) { if (item.element === "separator!") { switch (mode) { case 0: case 1: mode += 2; break; case 4: res.push(")"); mode = 3; break; } } if (!item.content) continue; switch (mode) { case 0: mode = 1; break; case 1: res.push(" "); break; case 2: res.push("("); mode = 4; break; case 3: res.push(" ("); mode = 4; break; case 4: res.push(", "); break; } res.push(item.content); } if (mode === 4) res.push(")"); return res.join(""); }; const indent = (str, prefix, noPrefixInFirstLine) => { const rem = str.replace(/\n([^\n])/g, "\n" + prefix + "$1"); if (noPrefixInFirstLine) return rem; const ind = str[0] === "\n" ? "" : prefix; return ind + rem; }; const joinExplicitNewLine = (items, indenter) => { let firstInLine = true; let first = true; return items .map(item => { if (!item || !item.content) return; let content = indent(item.content, first ? "" : indenter, !firstInLine); if (firstInLine) { content = content.replace(/^\n+/, ""); } if (!content) return; first = false; const noJoiner = firstInLine || content.startsWith("\n"); firstInLine = content.endsWith("\n"); return noJoiner ? content : " " + content; }) .filter(Boolean) .join("") .trim(); }; const joinError = error => (items, { red, yellow }) => `${error ? red("ERROR") : yellow("WARNING")} in ${joinExplicitNewLine( items, "" )}`; /** @type {Record string>} */ const SIMPLE_ELEMENT_JOINERS = { compilation: items => { const result = []; let lastNeedMore = false; for (const item of items) { if (!item.content) continue; const needMoreSpace = item.element === "warnings" || item.element === "filteredWarningDetailsCount" || item.element === "errors" || item.element === "filteredErrorDetailsCount" || item.element === "logging"; if (result.length !== 0) { result.push(needMoreSpace || lastNeedMore ? "\n\n" : "\n"); } result.push(item.content); lastNeedMore = needMoreSpace; } if (lastNeedMore) result.push("\n"); return result.join(""); }, asset: items => joinExplicitNewLine( items.map(item => { if ( (item.element === "related" || item.element === "children") && item.content ) { return { ...item, content: `\n${item.content}\n` }; } return item; }), " " ), "asset.info": joinOneLine, module: (items, { module }) => { let hasName = false; return joinExplicitNewLine( items.map(item => { switch (item.element) { case "id": if (module.id === module.name) { if (hasName) return false; if (item.content) hasName = true; } break; case "name": if (hasName) return false; if (item.content) hasName = true; break; case "providedExports": case "usedExports": case "optimizationBailout": case "reasons": case "issuerPath": case "profile": case "children": case "modules": if (item.content) { return { ...item, content: `\n${item.content}\n` }; } break; } return item; }), " " ); }, chunk: items => { let hasEntry = false; return ( "chunk " + joinExplicitNewLine( items.filter(item => { switch (item.element) { case "entry": if (item.content) hasEntry = true; break; case "initial": if (hasEntry) return false; break; } return true; }), " " ) ); }, "chunk.childrenByOrder[]": items => `(${joinOneLine(items)})`, chunkGroup: items => joinExplicitNewLine(items, " "), chunkGroupAsset: joinOneLine, chunkGroupChildGroup: joinOneLine, chunkGroupChild: joinOneLine, // moduleReason: (items, { moduleReason }) => { // let hasName = false; // return joinOneLine( // items.filter(item => { // switch (item.element) { // case "moduleId": // if (moduleReason.moduleId === moduleReason.module && item.content) // hasName = true; // break; // case "module": // if (hasName) return false; // break; // case "resolvedModule": // return ( // moduleReason.module !== moduleReason.resolvedModule && // item.content // ); // } // return true; // }) // ); // }, moduleReason: (items, { moduleReason }) => { let hasName = false; return joinExplicitNewLine( items.map(item => { switch (item.element) { case "moduleId": if (moduleReason.moduleId === moduleReason.module && item.content) hasName = true; break; case "module": if (hasName) return false; break; case "resolvedModule": if (moduleReason.module === moduleReason.resolvedModule) return false; break; case "children": if (item.content) { return { ...item, content: `\n${item.content}\n` }; } break; } return item; }), " " ); }, "module.profile": joinInBrackets, moduleIssuer: joinOneLine, chunkOrigin: items => "> " + joinOneLine(items), "errors[].error": joinError(true), "warnings[].error": joinError(false), loggingGroup: items => joinExplicitNewLine(items, "").trimRight(), moduleTraceItem: items => " @ " + joinOneLine(items), moduleTraceDependency: joinOneLine }; const AVAILABLE_COLORS = { bold: "\u001b[1m", yellow: "\u001b[1m\u001b[33m", red: "\u001b[1m\u001b[31m", green: "\u001b[1m\u001b[32m", cyan: "\u001b[1m\u001b[36m", magenta: "\u001b[1m\u001b[35m" }; const AVAILABLE_FORMATS = { formatChunkId: (id, { yellow }, direction) => { switch (direction) { case "parent": return `<{${yellow(id)}}>`; case "sibling": return `={${yellow(id)}}=`; case "child": return `>{${yellow(id)}}<`; default: return `{${yellow(id)}}`; } }, formatModuleId: id => `[${id}]`, formatFilename: (filename, { green, yellow }, oversize) => (oversize ? yellow : green)(filename), formatFlag: flag => `[${flag}]`, formatLayer: layer => `(in ${layer})`, formatSize: __webpack_require__(15979).formatSize, formatDateTime: (dateTime, { bold }) => { const d = new Date(dateTime); const x = twoDigit; const date = `${d.getFullYear()}-${x(d.getMonth() + 1)}-${x(d.getDate())}`; const time = `${x(d.getHours())}:${x(d.getMinutes())}:${x(d.getSeconds())}`; return `${date} ${bold(time)}`; }, formatTime: ( time, { timeReference, bold, green, yellow, red }, boldQuantity ) => { const unit = " ms"; if (timeReference && time !== timeReference) { const times = [ timeReference / 2, timeReference / 4, timeReference / 8, timeReference / 16 ]; if (time < times[3]) return `${time}${unit}`; else if (time < times[2]) return bold(`${time}${unit}`); else if (time < times[1]) return green(`${time}${unit}`); else if (time < times[0]) return yellow(`${time}${unit}`); else return red(`${time}${unit}`); } else { return `${boldQuantity ? bold(time) : time}${unit}`; } }, formatError: (message, { green, yellow, red }) => { if (message.includes("\u001b[")) return message; const highlights = [ { regExp: /(Did you mean .+)/g, format: green }, { regExp: /(Set 'mode' option to 'development' or 'production')/g, format: green }, { regExp: /(\(module has no exports\))/g, format: red }, { regExp: /\(possible exports: (.+)\)/g, format: green }, { regExp: /\s*([^\s].* doesn't exist)/g, format: red }, { regExp: /('\w+' option has not been set)/g, format: red }, { regExp: /(Emitted value instead of an instance of Error)/g, format: yellow }, { regExp: /(Used? .+ instead)/gi, format: yellow }, { regExp: /\b(deprecated|must|required)\b/g, format: yellow }, { regExp: /\b(BREAKING CHANGE)\b/gi, format: red }, { regExp: /\b(error|failed|unexpected|invalid|not found|not supported|not available|not possible|not implemented|doesn't support|conflict|conflicting|not existing|duplicate)\b/gi, format: red } ]; for (const { regExp, format } of highlights) { message = message.replace(regExp, (match, content) => { return match.replace(content, format(content)); }); } return message; } }; const RESULT_MODIFIER = { "module.modules": result => { return indent(result, "| "); } }; const createOrder = (array, preferredOrder) => { const originalArray = array.slice(); const set = new Set(array); const usedSet = new Set(); array.length = 0; for (const element of preferredOrder) { if (element.endsWith("!") || set.has(element)) { array.push(element); usedSet.add(element); } } for (const element of originalArray) { if (!usedSet.has(element)) { array.push(element); } } return array; }; class DefaultStatsPrinterPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap("DefaultStatsPrinterPlugin", compilation => { compilation.hooks.statsPrinter.tap( "DefaultStatsPrinterPlugin", (stats, options, context) => { // Put colors into context stats.hooks.print .for("compilation") .tap("DefaultStatsPrinterPlugin", (compilation, context) => { for (const color of Object.keys(AVAILABLE_COLORS)) { let start; if (options.colors) { if ( typeof options.colors === "object" && typeof options.colors[color] === "string" ) { start = options.colors[color]; } else { start = AVAILABLE_COLORS[color]; } } if (start) { context[color] = str => `${start}${ typeof str === "string" ? str.replace( /((\u001b\[39m|\u001b\[22m|\u001b\[0m)+)/g, `$1${start}` ) : str }\u001b[39m\u001b[22m`; } else { context[color] = str => str; } } for (const format of Object.keys(AVAILABLE_FORMATS)) { context[format] = (content, ...args) => AVAILABLE_FORMATS[format](content, context, ...args); } context.timeReference = compilation.time; }); for (const key of Object.keys(SIMPLE_PRINTERS)) { stats.hooks.print .for(key) .tap("DefaultStatsPrinterPlugin", (obj, ctx) => SIMPLE_PRINTERS[key](obj, ctx, stats) ); } for (const key of Object.keys(PREFERRED_ORDERS)) { const preferredOrder = PREFERRED_ORDERS[key]; stats.hooks.sortElements .for(key) .tap("DefaultStatsPrinterPlugin", (elements, context) => { createOrder(elements, preferredOrder); }); } for (const key of Object.keys(ITEM_NAMES)) { const itemName = ITEM_NAMES[key]; stats.hooks.getItemName .for(key) .tap( "DefaultStatsPrinterPlugin", typeof itemName === "string" ? () => itemName : itemName ); } for (const key of Object.keys(SIMPLE_ITEMS_JOINER)) { const joiner = SIMPLE_ITEMS_JOINER[key]; stats.hooks.printItems .for(key) .tap("DefaultStatsPrinterPlugin", joiner); } for (const key of Object.keys(SIMPLE_ELEMENT_JOINERS)) { const joiner = SIMPLE_ELEMENT_JOINERS[key]; stats.hooks.printElements .for(key) .tap("DefaultStatsPrinterPlugin", joiner); } for (const key of Object.keys(RESULT_MODIFIER)) { const modifier = RESULT_MODIFIER[key]; stats.hooks.result .for(key) .tap("DefaultStatsPrinterPlugin", modifier); } } ); }); } } module.exports = DefaultStatsPrinterPlugin; /***/ }), /***/ 69646: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { HookMap, SyncBailHook, SyncWaterfallHook } = __webpack_require__(34718); const { concatComparators, keepOriginalOrder } = __webpack_require__(26296); const smartGrouping = __webpack_require__(84820); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../WebpackError")} WebpackError */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ /** @typedef {import("../util/smartGrouping").GroupConfig} GroupConfig */ /** * @typedef {Object} KnownStatsFactoryContext * @property {string} type * @property {function(string): string=} makePathsRelative * @property {Compilation=} compilation * @property {Set=} rootModules * @property {Map=} compilationFileToChunks * @property {Map=} compilationAuxiliaryFileToChunks * @property {RuntimeSpec=} runtime * @property {function(Compilation): WebpackError[]=} cachedGetErrors * @property {function(Compilation): WebpackError[]=} cachedGetWarnings */ /** @typedef {KnownStatsFactoryContext & Record} StatsFactoryContext */ class StatsFactory { constructor() { this.hooks = Object.freeze({ /** @type {HookMap>} */ extract: new HookMap( () => new SyncBailHook(["object", "data", "context"]) ), /** @type {HookMap>} */ filter: new HookMap( () => new SyncBailHook(["item", "context", "index", "unfilteredIndex"]) ), /** @type {HookMap>} */ sort: new HookMap(() => new SyncBailHook(["comparators", "context"])), /** @type {HookMap>} */ filterSorted: new HookMap( () => new SyncBailHook(["item", "context", "index", "unfilteredIndex"]) ), /** @type {HookMap>} */ groupResults: new HookMap( () => new SyncBailHook(["groupConfigs", "context"]) ), /** @type {HookMap>} */ sortResults: new HookMap( () => new SyncBailHook(["comparators", "context"]) ), /** @type {HookMap>} */ filterResults: new HookMap( () => new SyncBailHook(["item", "context", "index", "unfilteredIndex"]) ), /** @type {HookMap>} */ merge: new HookMap(() => new SyncBailHook(["items", "context"])), /** @type {HookMap>} */ result: new HookMap(() => new SyncWaterfallHook(["result", "context"])), /** @type {HookMap>} */ getItemName: new HookMap(() => new SyncBailHook(["item", "context"])), /** @type {HookMap>} */ getItemFactory: new HookMap(() => new SyncBailHook(["item", "context"])) }); const hooks = this.hooks; this._caches = /** @type {Record[]>>} */ ({}); for (const key of Object.keys(hooks)) { this._caches[key] = new Map(); } this._inCreate = false; } _getAllLevelHooks(hookMap, cache, type) { const cacheEntry = cache.get(type); if (cacheEntry !== undefined) { return cacheEntry; } const hooks = []; const typeParts = type.split("."); for (let i = 0; i < typeParts.length; i++) { const hook = hookMap.get(typeParts.slice(i).join(".")); if (hook) { hooks.push(hook); } } cache.set(type, hooks); return hooks; } _forEachLevel(hookMap, cache, type, fn) { for (const hook of this._getAllLevelHooks(hookMap, cache, type)) { const result = fn(hook); if (result !== undefined) return result; } } _forEachLevelWaterfall(hookMap, cache, type, data, fn) { for (const hook of this._getAllLevelHooks(hookMap, cache, type)) { data = fn(hook, data); } return data; } _forEachLevelFilter(hookMap, cache, type, items, fn, forceClone) { const hooks = this._getAllLevelHooks(hookMap, cache, type); if (hooks.length === 0) return forceClone ? items.slice() : items; let i = 0; return items.filter((item, idx) => { for (const hook of hooks) { const r = fn(hook, item, idx, i); if (r !== undefined) { if (r) i++; return r; } } i++; return true; }); } /** * @param {string} type type * @param {any} data factory data * @param {Omit} baseContext context used as base * @returns {any} created object */ create(type, data, baseContext) { if (this._inCreate) { return this._create(type, data, baseContext); } else { try { this._inCreate = true; return this._create(type, data, baseContext); } finally { for (const key of Object.keys(this._caches)) this._caches[key].clear(); this._inCreate = false; } } } _create(type, data, baseContext) { const context = { ...baseContext, type, [type]: data }; if (Array.isArray(data)) { // run filter on unsorted items const items = this._forEachLevelFilter( this.hooks.filter, this._caches.filter, type, data, (h, r, idx, i) => h.call(r, context, idx, i), true ); // sort items const comparators = []; this._forEachLevel(this.hooks.sort, this._caches.sort, type, h => h.call(comparators, context) ); if (comparators.length > 0) { items.sort( // @ts-expect-error number of arguments is correct concatComparators(...comparators, keepOriginalOrder(items)) ); } // run filter on sorted items const items2 = this._forEachLevelFilter( this.hooks.filterSorted, this._caches.filterSorted, type, items, (h, r, idx, i) => h.call(r, context, idx, i), false ); // for each item let resultItems = items2.map((item, i) => { const itemContext = { ...context, _index: i }; // run getItemName const itemName = this._forEachLevel( this.hooks.getItemName, this._caches.getItemName, `${type}[]`, h => h.call(item, itemContext) ); if (itemName) itemContext[itemName] = item; const innerType = itemName ? `${type}[].${itemName}` : `${type}[]`; // run getItemFactory const itemFactory = this._forEachLevel( this.hooks.getItemFactory, this._caches.getItemFactory, innerType, h => h.call(item, itemContext) ) || this; // run item factory return itemFactory.create(innerType, item, itemContext); }); // sort result items const comparators2 = []; this._forEachLevel( this.hooks.sortResults, this._caches.sortResults, type, h => h.call(comparators2, context) ); if (comparators2.length > 0) { resultItems.sort( // @ts-expect-error number of arguments is correct concatComparators(...comparators2, keepOriginalOrder(resultItems)) ); } // group result items const groupConfigs = []; this._forEachLevel( this.hooks.groupResults, this._caches.groupResults, type, h => h.call(groupConfigs, context) ); if (groupConfigs.length > 0) { resultItems = smartGrouping(resultItems, groupConfigs); } // run filter on sorted result items const finalResultItems = this._forEachLevelFilter( this.hooks.filterResults, this._caches.filterResults, type, resultItems, (h, r, idx, i) => h.call(r, context, idx, i), false ); // run merge on mapped items let result = this._forEachLevel( this.hooks.merge, this._caches.merge, type, h => h.call(finalResultItems, context) ); if (result === undefined) result = finalResultItems; // run result on merged items return this._forEachLevelWaterfall( this.hooks.result, this._caches.result, type, result, (h, r) => h.call(r, context) ); } else { const object = {}; // run extract on value this._forEachLevel(this.hooks.extract, this._caches.extract, type, h => h.call(object, data, context) ); // run result on extracted object return this._forEachLevelWaterfall( this.hooks.result, this._caches.result, type, object, (h, r) => h.call(r, context) ); } } } module.exports = StatsFactory; /***/ }), /***/ 61025: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { HookMap, SyncWaterfallHook, SyncBailHook } = __webpack_require__(34718); /** @template T @typedef {import("tapable").AsArray} AsArray */ /** @typedef {import("tapable").Hook} Hook */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsAsset} StatsAsset */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsChunk} StatsChunk */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsChunkGroup} StatsChunkGroup */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsModule} StatsModule */ /** @typedef {import("./DefaultStatsFactoryPlugin").StatsModuleReason} StatsModuleReason */ /** * @typedef {Object} PrintedElement * @property {string} element * @property {string} content */ /** * @typedef {Object} KnownStatsPrinterContext * @property {string=} type * @property {StatsCompilation=} compilation * @property {StatsChunkGroup=} chunkGroup * @property {StatsAsset=} asset * @property {StatsModule=} module * @property {StatsChunk=} chunk * @property {StatsModuleReason=} moduleReason * @property {(str: string) => string=} bold * @property {(str: string) => string=} yellow * @property {(str: string) => string=} red * @property {(str: string) => string=} green * @property {(str: string) => string=} magenta * @property {(str: string) => string=} cyan * @property {(file: string, oversize?: boolean) => string=} formatFilename * @property {(id: string) => string=} formatModuleId * @property {(id: string, direction?: "parent"|"child"|"sibling") => string=} formatChunkId * @property {(size: number) => string=} formatSize * @property {(dateTime: number) => string=} formatDateTime * @property {(flag: string) => string=} formatFlag * @property {(time: number, boldQuantity?: boolean) => string=} formatTime * @property {string=} chunkGroupKind */ /** @typedef {KnownStatsPrinterContext & Record} StatsPrinterContext */ class StatsPrinter { constructor() { this.hooks = Object.freeze({ /** @type {HookMap>} */ sortElements: new HookMap( () => new SyncBailHook(["elements", "context"]) ), /** @type {HookMap>} */ printElements: new HookMap( () => new SyncBailHook(["printedElements", "context"]) ), /** @type {HookMap>} */ sortItems: new HookMap(() => new SyncBailHook(["items", "context"])), /** @type {HookMap>} */ getItemName: new HookMap(() => new SyncBailHook(["item", "context"])), /** @type {HookMap>} */ printItems: new HookMap( () => new SyncBailHook(["printedItems", "context"]) ), /** @type {HookMap>} */ print: new HookMap(() => new SyncBailHook(["object", "context"])), /** @type {HookMap>} */ result: new HookMap(() => new SyncWaterfallHook(["result", "context"])) }); /** @type {Map, Map>} */ this._levelHookCache = new Map(); this._inPrint = false; } /** * get all level hooks * @private * @template {Hook} T * @param {HookMap} hookMap HookMap * @param {string} type type * @returns {T[]} hooks */ _getAllLevelHooks(hookMap, type) { let cache = /** @type {Map} */ ( this._levelHookCache.get(hookMap) ); if (cache === undefined) { cache = new Map(); this._levelHookCache.set(hookMap, cache); } const cacheEntry = cache.get(type); if (cacheEntry !== undefined) { return cacheEntry; } /** @type {T[]} */ const hooks = []; const typeParts = type.split("."); for (let i = 0; i < typeParts.length; i++) { const hook = hookMap.get(typeParts.slice(i).join(".")); if (hook) { hooks.push(hook); } } cache.set(type, hooks); return hooks; } /** * Run `fn` for each level * @private * @template T * @template R * @param {HookMap>} hookMap HookMap * @param {string} type type * @param {(hook: SyncBailHook) => R} fn function * @returns {R} result of `fn` */ _forEachLevel(hookMap, type, fn) { for (const hook of this._getAllLevelHooks(hookMap, type)) { const result = fn(hook); if (result !== undefined) return result; } } /** * Run `fn` for each level * @private * @template T * @param {HookMap>} hookMap HookMap * @param {string} type type * @param {AsArray[0]} data data * @param {(hook: SyncWaterfallHook, data: AsArray[0]) => AsArray[0]} fn function * @returns {AsArray[0]} result of `fn` */ _forEachLevelWaterfall(hookMap, type, data, fn) { for (const hook of this._getAllLevelHooks(hookMap, type)) { data = fn(hook, data); } return data; } /** * @param {string} type The type * @param {Object} object Object to print * @param {Object=} baseContext The base context * @returns {string} printed result */ print(type, object, baseContext) { if (this._inPrint) { return this._print(type, object, baseContext); } else { try { this._inPrint = true; return this._print(type, object, baseContext); } finally { this._levelHookCache.clear(); this._inPrint = false; } } } /** * @private * @param {string} type type * @param {Object} object object * @param {Object=} baseContext context * @returns {string} printed result */ _print(type, object, baseContext) { const context = { ...baseContext, type, [type]: object }; let printResult = this._forEachLevel(this.hooks.print, type, hook => hook.call(object, context) ); if (printResult === undefined) { if (Array.isArray(object)) { const sortedItems = object.slice(); this._forEachLevel(this.hooks.sortItems, type, h => h.call(sortedItems, context) ); const printedItems = sortedItems.map((item, i) => { const itemContext = { ...context, _index: i }; const itemName = this._forEachLevel( this.hooks.getItemName, `${type}[]`, h => h.call(item, itemContext) ); if (itemName) itemContext[itemName] = item; return this.print( itemName ? `${type}[].${itemName}` : `${type}[]`, item, itemContext ); }); printResult = this._forEachLevel(this.hooks.printItems, type, h => h.call(printedItems, context) ); if (printResult === undefined) { const result = printedItems.filter(Boolean); if (result.length > 0) printResult = result.join("\n"); } } else if (object !== null && typeof object === "object") { const elements = Object.keys(object).filter( key => object[key] !== undefined ); this._forEachLevel(this.hooks.sortElements, type, h => h.call(elements, context) ); const printedElements = elements.map(element => { const content = this.print(`${type}.${element}`, object[element], { ...context, _parent: object, _element: element, [element]: object[element] }); return { element, content }; }); printResult = this._forEachLevel(this.hooks.printElements, type, h => h.call(printedElements, context) ); if (printResult === undefined) { const result = printedElements.map(e => e.content).filter(Boolean); if (result.length > 0) printResult = result.join("\n"); } } } return this._forEachLevelWaterfall( this.hooks.result, type, printResult, (h, r) => h.call(r, context) ); } } module.exports = StatsPrinter; /***/ }), /***/ 21537: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ exports.equals = (a, b) => { if (a.length !== b.length) return false; for (let i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; }; /** * * @param {Array} arr Array of values to be partitioned * @param {(value: any) => boolean} fn Partition function which partitions based on truthiness of result. * @returns {[Array, Array]} returns the values of `arr` partitioned into two new arrays based on fn predicate. */ exports.groupBy = (arr = [], fn) => { return arr.reduce( (groups, value) => { groups[fn(value) ? 0 : 1].push(value); return groups; }, [[], []] ); }; /***/ }), /***/ 29704: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template T */ class ArrayQueue { /** * @param {Iterable=} items The initial elements. */ constructor(items) { /** @private @type {T[]} */ this._list = items ? Array.from(items) : []; /** @private @type {T[]} */ this._listReversed = []; } /** * Returns the number of elements in this queue. * @returns {number} The number of elements in this queue. */ get length() { return this._list.length + this._listReversed.length; } /** * Empties the queue. */ clear() { this._list.length = 0; this._listReversed.length = 0; } /** * Appends the specified element to this queue. * @param {T} item The element to add. * @returns {void} */ enqueue(item) { this._list.push(item); } /** * Retrieves and removes the head of this queue. * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty. */ dequeue() { if (this._listReversed.length === 0) { if (this._list.length === 0) return undefined; if (this._list.length === 1) return this._list.pop(); if (this._list.length < 16) return this._list.shift(); const temp = this._listReversed; this._listReversed = this._list; this._listReversed.reverse(); this._list = temp; } return this._listReversed.pop(); } /** * Finds and removes an item * @param {T} item the item * @returns {void} */ delete(item) { const i = this._list.indexOf(item); if (i >= 0) { this._list.splice(i, 1); } else { const i = this._listReversed.indexOf(item); if (i >= 0) this._listReversed.splice(i, 1); } } [Symbol.iterator]() { let i = -1; let reversed = false; return { next: () => { if (!reversed) { i++; if (i < this._list.length) { return { done: false, value: this._list[i] }; } reversed = true; i = this._listReversed.length; } i--; if (i < 0) { return { done: true, value: undefined }; } return { done: false, value: this._listReversed[i] }; } }; } } module.exports = ArrayQueue; /***/ }), /***/ 55531: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { SyncHook, AsyncSeriesHook } = __webpack_require__(34718); const { makeWebpackError } = __webpack_require__(89935); const WebpackError = __webpack_require__(68422); const ArrayQueue = __webpack_require__(29704); const QUEUED_STATE = 0; const PROCESSING_STATE = 1; const DONE_STATE = 2; let inHandleResult = 0; /** * @template T * @callback Callback * @param {WebpackError=} err * @param {T=} result */ /** * @template T * @template K * @template R */ class AsyncQueueEntry { /** * @param {T} item the item * @param {Callback} callback the callback */ constructor(item, callback) { this.item = item; /** @type {typeof QUEUED_STATE | typeof PROCESSING_STATE | typeof DONE_STATE} */ this.state = QUEUED_STATE; this.callback = callback; /** @type {Callback[] | undefined} */ this.callbacks = undefined; this.result = undefined; /** @type {WebpackError | undefined} */ this.error = undefined; } } /** * @template T * @template K * @template R */ class AsyncQueue { /** * @param {Object} options options object * @param {string=} options.name name of the queue * @param {number=} options.parallelism how many items should be processed at once * @param {AsyncQueue=} options.parent parent queue, which will have priority over this queue and with shared parallelism * @param {function(T): K=} options.getKey extract key from item * @param {function(T, Callback): void} options.processor async function to process items */ constructor({ name, parallelism, parent, processor, getKey }) { this._name = name; this._parallelism = parallelism || 1; this._processor = processor; this._getKey = getKey || /** @type {(T) => K} */ (item => /** @type {any} */ (item)); /** @type {Map>} */ this._entries = new Map(); /** @type {ArrayQueue>} */ this._queued = new ArrayQueue(); /** @type {AsyncQueue[]} */ this._children = undefined; this._activeTasks = 0; this._willEnsureProcessing = false; this._needProcessing = false; this._stopped = false; this._root = parent ? parent._root : this; if (parent) { if (this._root._children === undefined) { this._root._children = [this]; } else { this._root._children.push(this); } } this.hooks = { /** @type {AsyncSeriesHook<[T]>} */ beforeAdd: new AsyncSeriesHook(["item"]), /** @type {SyncHook<[T]>} */ added: new SyncHook(["item"]), /** @type {AsyncSeriesHook<[T]>} */ beforeStart: new AsyncSeriesHook(["item"]), /** @type {SyncHook<[T]>} */ started: new SyncHook(["item"]), /** @type {SyncHook<[T, Error, R]>} */ result: new SyncHook(["item", "error", "result"]) }; this._ensureProcessing = this._ensureProcessing.bind(this); } /** * @param {T} item an item * @param {Callback} callback callback function * @returns {void} */ add(item, callback) { if (this._stopped) return callback(new WebpackError("Queue was stopped")); this.hooks.beforeAdd.callAsync(item, err => { if (err) { callback( makeWebpackError(err, `AsyncQueue(${this._name}).hooks.beforeAdd`) ); return; } const key = this._getKey(item); const entry = this._entries.get(key); if (entry !== undefined) { if (entry.state === DONE_STATE) { if (inHandleResult++ > 3) { process.nextTick(() => callback(entry.error, entry.result)); } else { callback(entry.error, entry.result); } inHandleResult--; } else if (entry.callbacks === undefined) { entry.callbacks = [callback]; } else { entry.callbacks.push(callback); } return; } const newEntry = new AsyncQueueEntry(item, callback); if (this._stopped) { this.hooks.added.call(item); this._root._activeTasks++; process.nextTick(() => this._handleResult(newEntry, new WebpackError("Queue was stopped")) ); } else { this._entries.set(key, newEntry); this._queued.enqueue(newEntry); const root = this._root; root._needProcessing = true; if (root._willEnsureProcessing === false) { root._willEnsureProcessing = true; setImmediate(root._ensureProcessing); } this.hooks.added.call(item); } }); } /** * @param {T} item an item * @returns {void} */ invalidate(item) { const key = this._getKey(item); const entry = this._entries.get(key); this._entries.delete(key); if (entry.state === QUEUED_STATE) { this._queued.delete(entry); } } /** * Waits for an already started item * @param {T} item an item * @param {Callback} callback callback function * @returns {void} */ waitFor(item, callback) { const key = this._getKey(item); const entry = this._entries.get(key); if (entry === undefined) { return callback( new WebpackError( "waitFor can only be called for an already started item" ) ); } if (entry.state === DONE_STATE) { process.nextTick(() => callback(entry.error, entry.result)); } else if (entry.callbacks === undefined) { entry.callbacks = [callback]; } else { entry.callbacks.push(callback); } } /** * @returns {void} */ stop() { this._stopped = true; const queue = this._queued; this._queued = new ArrayQueue(); const root = this._root; for (const entry of queue) { this._entries.delete(this._getKey(entry.item)); root._activeTasks++; this._handleResult(entry, new WebpackError("Queue was stopped")); } } /** * @returns {void} */ increaseParallelism() { const root = this._root; root._parallelism++; /* istanbul ignore next */ if (root._willEnsureProcessing === false && root._needProcessing) { root._willEnsureProcessing = true; setImmediate(root._ensureProcessing); } } /** * @returns {void} */ decreaseParallelism() { const root = this._root; root._parallelism--; } /** * @param {T} item an item * @returns {boolean} true, if the item is currently being processed */ isProcessing(item) { const key = this._getKey(item); const entry = this._entries.get(key); return entry !== undefined && entry.state === PROCESSING_STATE; } /** * @param {T} item an item * @returns {boolean} true, if the item is currently queued */ isQueued(item) { const key = this._getKey(item); const entry = this._entries.get(key); return entry !== undefined && entry.state === QUEUED_STATE; } /** * @param {T} item an item * @returns {boolean} true, if the item is currently queued */ isDone(item) { const key = this._getKey(item); const entry = this._entries.get(key); return entry !== undefined && entry.state === DONE_STATE; } /** * @returns {void} */ _ensureProcessing() { while (this._activeTasks < this._parallelism) { const entry = this._queued.dequeue(); if (entry === undefined) break; this._activeTasks++; entry.state = PROCESSING_STATE; this._startProcessing(entry); } this._willEnsureProcessing = false; if (this._queued.length > 0) return; if (this._children !== undefined) { for (const child of this._children) { while (this._activeTasks < this._parallelism) { const entry = child._queued.dequeue(); if (entry === undefined) break; this._activeTasks++; entry.state = PROCESSING_STATE; child._startProcessing(entry); } if (child._queued.length > 0) return; } } if (!this._willEnsureProcessing) this._needProcessing = false; } /** * @param {AsyncQueueEntry} entry the entry * @returns {void} */ _startProcessing(entry) { this.hooks.beforeStart.callAsync(entry.item, err => { if (err) { this._handleResult( entry, makeWebpackError(err, `AsyncQueue(${this._name}).hooks.beforeStart`) ); return; } let inCallback = false; try { this._processor(entry.item, (e, r) => { inCallback = true; this._handleResult(entry, e, r); }); } catch (err) { if (inCallback) throw err; this._handleResult(entry, err, null); } this.hooks.started.call(entry.item); }); } /** * @param {AsyncQueueEntry} entry the entry * @param {WebpackError=} err error, if any * @param {R=} result result, if any * @returns {void} */ _handleResult(entry, err, result) { this.hooks.result.callAsync(entry.item, err, result, hookError => { const error = hookError ? makeWebpackError(hookError, `AsyncQueue(${this._name}).hooks.result`) : err; const callback = entry.callback; const callbacks = entry.callbacks; entry.state = DONE_STATE; entry.callback = undefined; entry.callbacks = undefined; entry.result = result; entry.error = error; const root = this._root; root._activeTasks--; if (root._willEnsureProcessing === false && root._needProcessing) { root._willEnsureProcessing = true; setImmediate(root._ensureProcessing); } if (inHandleResult++ > 3) { process.nextTick(() => { callback(error, result); if (callbacks !== undefined) { for (const callback of callbacks) { callback(error, result); } } }); } else { callback(error, result); if (callbacks !== undefined) { for (const callback of callbacks) { callback(error, result); } } } inHandleResult--; }); } clear() { this._entries.clear(); this._queued.clear(); this._activeTasks = 0; this._willEnsureProcessing = false; this._needProcessing = false; this._stopped = false; } } module.exports = AsyncQueue; /***/ }), /***/ 21301: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ class Hash { /* istanbul ignore next */ /** * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} * @abstract * @param {string|Buffer} data data * @param {string=} inputEncoding data encoding * @returns {this} updated hash */ update(data, inputEncoding) { const AbstractMethodError = __webpack_require__(570); throw new AbstractMethodError(); } /* istanbul ignore next */ /** * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @abstract * @param {string=} encoding encoding of the return value * @returns {string|Buffer} digest */ digest(encoding) { const AbstractMethodError = __webpack_require__(570); throw new AbstractMethodError(); } } module.exports = Hash; /***/ }), /***/ 31065: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template T * @param {Iterable} set a set * @returns {T | undefined} last item */ const last = set => { let last; for (const item of set) last = item; return last; }; /** * @template T * @param {Iterable} iterable iterable * @param {function(T): boolean} filter predicate * @returns {boolean} true, if some items match the filter predicate */ const someInIterable = (iterable, filter) => { for (const item of iterable) { if (filter(item)) return true; } return false; }; /** * @template T * @param {Iterable} iterable an iterable * @returns {number} count of items */ const countIterable = iterable => { let i = 0; // eslint-disable-next-line no-unused-vars for (const _ of iterable) i++; return i; }; exports.last = last; exports.someInIterable = someInIterable; exports.countIterable = countIterable; /***/ }), /***/ 79300: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { first } = __webpack_require__(34715); const SortableSet = __webpack_require__(67563); /** * Multi layer bucket sorted set: * Supports adding non-existing items (DO NOT ADD ITEM TWICE), * Supports removing exiting items (DO NOT REMOVE ITEM NOT IN SET), * Supports popping the first items according to defined order, * Supports iterating all items without order, * Supports updating an item in an efficient way, * Supports size property, which is the number of items, * Items are lazy partially sorted when needed * @template T * @template K */ class LazyBucketSortedSet { /** * @param {function(T): K} getKey function to get key from item * @param {function(K, K): number} comparator comparator to sort keys * @param {...((function(T): any) | (function(any, any): number))} args more pairs of getKey and comparator plus optional final comparator for the last layer */ constructor(getKey, comparator, ...args) { this._getKey = getKey; this._innerArgs = args; this._leaf = args.length <= 1; this._keys = new SortableSet(undefined, comparator); /** @type {Map | SortableSet>} */ this._map = new Map(); this._unsortedItems = new Set(); this.size = 0; } /** * @param {T} item an item * @returns {void} */ add(item) { this.size++; this._unsortedItems.add(item); } /** * @param {K} key key of item * @param {T} item the item * @returns {void} */ _addInternal(key, item) { let entry = this._map.get(key); if (entry === undefined) { entry = this._leaf ? new SortableSet(undefined, this._innerArgs[0]) : new /** @type {any} */ (LazyBucketSortedSet)(...this._innerArgs); this._keys.add(key); this._map.set(key, entry); } entry.add(item); } /** * @param {T} item an item * @returns {void} */ delete(item) { this.size--; if (this._unsortedItems.has(item)) { this._unsortedItems.delete(item); return; } const key = this._getKey(item); const entry = this._map.get(key); entry.delete(item); if (entry.size === 0) { this._deleteKey(key); } } /** * @param {K} key key to be removed * @returns {void} */ _deleteKey(key) { this._keys.delete(key); this._map.delete(key); } /** * @returns {T | undefined} an item */ popFirst() { if (this.size === 0) return undefined; this.size--; if (this._unsortedItems.size > 0) { for (const item of this._unsortedItems) { const key = this._getKey(item); this._addInternal(key, item); } this._unsortedItems.clear(); } this._keys.sort(); const key = first(this._keys); const entry = this._map.get(key); if (this._leaf) { const leafEntry = /** @type {SortableSet} */ (entry); leafEntry.sort(); const item = first(leafEntry); leafEntry.delete(item); if (leafEntry.size === 0) { this._deleteKey(key); } return item; } else { const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); const item = nodeEntry.popFirst(); if (nodeEntry.size === 0) { this._deleteKey(key); } return item; } } /** * @param {T} item to be updated item * @returns {function(true=): void} finish update */ startUpdate(item) { if (this._unsortedItems.has(item)) { return remove => { if (remove) { this._unsortedItems.delete(item); this.size--; return; } }; } const key = this._getKey(item); if (this._leaf) { const oldEntry = /** @type {SortableSet} */ (this._map.get(key)); return remove => { if (remove) { this.size--; oldEntry.delete(item); if (oldEntry.size === 0) { this._deleteKey(key); } return; } const newKey = this._getKey(item); if (key === newKey) { // This flags the sortable set as unordered oldEntry.add(item); } else { oldEntry.delete(item); if (oldEntry.size === 0) { this._deleteKey(key); } this._addInternal(newKey, item); } }; } else { const oldEntry = /** @type {LazyBucketSortedSet} */ ( this._map.get(key) ); const finishUpdate = oldEntry.startUpdate(item); return remove => { if (remove) { this.size--; finishUpdate(true); if (oldEntry.size === 0) { this._deleteKey(key); } return; } const newKey = this._getKey(item); if (key === newKey) { finishUpdate(); } else { finishUpdate(true); if (oldEntry.size === 0) { this._deleteKey(key); } this._addInternal(newKey, item); } }; } } /** * @param {Iterator[]} iterators list of iterators to append to * @returns {void} */ _appendIterators(iterators) { if (this._unsortedItems.size > 0) iterators.push(this._unsortedItems[Symbol.iterator]()); for (const key of this._keys) { const entry = this._map.get(key); if (this._leaf) { const leafEntry = /** @type {SortableSet} */ (entry); const iterator = leafEntry[Symbol.iterator](); iterators.push(iterator); } else { const nodeEntry = /** @type {LazyBucketSortedSet} */ (entry); nodeEntry._appendIterators(iterators); } } } /** * @returns {Iterator} the iterator */ [Symbol.iterator]() { const iterators = []; this._appendIterators(iterators); iterators.reverse(); let currentIterator = iterators.pop(); return { next: () => { const res = currentIterator.next(); if (res.done) { if (iterators.length === 0) return res; currentIterator = iterators.pop(); return currentIterator.next(); } return res; } }; } } module.exports = LazyBucketSortedSet; /***/ }), /***/ 59534: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const makeSerializable = __webpack_require__(26522); /** * @template T * @param {Set} targetSet set where items should be added * @param {Set>} toMerge iterables to be merged * @returns {void} */ const merge = (targetSet, toMerge) => { for (const set of toMerge) { for (const item of set) { targetSet.add(item); } } }; /** * @template T * @param {Set>} targetSet set where iterables should be added * @param {Array>} toDeepMerge lazy sets to be flattened * @returns {void} */ const flatten = (targetSet, toDeepMerge) => { for (const set of toDeepMerge) { if (set._set.size > 0) targetSet.add(set._set); if (set._needMerge) { for (const mergedSet of set._toMerge) { targetSet.add(mergedSet); } flatten(targetSet, set._toDeepMerge); } } }; /** * Like Set but with an addAll method to eventually add items from another iterable. * Access methods make sure that all delayed operations are executed. * Iteration methods deopts to normal Set performance until clear is called again (because of the chance of modifications during iteration). * @template T */ class LazySet { /** * @param {Iterable=} iterable init iterable */ constructor(iterable) { /** @type {Set} */ this._set = new Set(iterable); /** @type {Set>} */ this._toMerge = new Set(); /** @type {Array>} */ this._toDeepMerge = []; this._needMerge = false; this._deopt = false; } _flatten() { flatten(this._toMerge, this._toDeepMerge); this._toDeepMerge.length = 0; } _merge() { this._flatten(); merge(this._set, this._toMerge); this._toMerge.clear(); this._needMerge = false; } _isEmpty() { return ( this._set.size === 0 && this._toMerge.size === 0 && this._toDeepMerge.length === 0 ); } get size() { if (this._needMerge) this._merge(); return this._set.size; } /** * @param {T} item an item * @returns {this} itself */ add(item) { this._set.add(item); return this; } /** * @param {Iterable | LazySet} iterable a immutable iterable or another immutable LazySet which will eventually be merged into the Set * @returns {this} itself */ addAll(iterable) { if (this._deopt) { const _set = this._set; for (const item of iterable) { _set.add(item); } } else { if (iterable instanceof LazySet) { if (iterable._isEmpty()) return this; this._toDeepMerge.push(iterable); this._needMerge = true; if (this._toDeepMerge.length > 100000) { this._flatten(); } } else { this._toMerge.add(iterable); this._needMerge = true; } if (this._toMerge.size > 100000) this._merge(); } return this; } clear() { this._set.clear(); this._toMerge.clear(); this._toDeepMerge.length = 0; this._needMerge = false; this._deopt = false; } /** * @param {T} value an item * @returns {boolean} true, if the value was in the Set before */ delete(value) { if (this._needMerge) this._merge(); return this._set.delete(value); } entries() { this._deopt = true; if (this._needMerge) this._merge(); return this._set.entries(); } /** * @param {function(T, T, Set): void} callbackFn function called for each entry * @param {any} thisArg this argument for the callbackFn * @returns {void} */ forEach(callbackFn, thisArg) { this._deopt = true; if (this._needMerge) this._merge(); this._set.forEach(callbackFn, thisArg); } /** * @param {T} item an item * @returns {boolean} true, when the item is in the Set */ has(item) { if (this._needMerge) this._merge(); return this._set.has(item); } keys() { this._deopt = true; if (this._needMerge) this._merge(); return this._set.keys(); } values() { this._deopt = true; if (this._needMerge) this._merge(); return this._set.values(); } [Symbol.iterator]() { this._deopt = true; if (this._needMerge) this._merge(); return this._set[Symbol.iterator](); } /* istanbul ignore next */ get [Symbol.toStringTag]() { return "LazySet"; } serialize({ write }) { if (this._needMerge) this._merge(); write(this._set.size); for (const item of this._set) write(item); } static deserialize({ read }) { const count = read(); const items = []; for (let i = 0; i < count; i++) { items.push(read()); } return new LazySet(items); } } makeSerializable(LazySet, "webpack/lib/util/LazySet"); module.exports = LazySet; /***/ }), /***/ 30498: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template K * @template V * @param {Map} map a map * @param {K} key the key * @param {function(): V} computer compute value * @returns {V} value */ exports.provide = (map, key, computer) => { const value = map.get(key); if (value !== undefined) return value; const newValue = computer(); map.set(key, newValue); return newValue; }; /***/ }), /***/ 67491: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const binarySearchBounds = __webpack_require__(44795); class ParallelismFactorCalculator { constructor() { this._rangePoints = []; this._rangeCallbacks = []; } range(start, end, callback) { if (start === end) return callback(1); this._rangePoints.push(start); this._rangePoints.push(end); this._rangeCallbacks.push(callback); } calculate() { const segments = Array.from(new Set(this._rangePoints)).sort((a, b) => a < b ? -1 : 1 ); const parallelism = segments.map(() => 0); const rangeStartIndices = []; for (let i = 0; i < this._rangePoints.length; i += 2) { const start = this._rangePoints[i]; const end = this._rangePoints[i + 1]; let idx = binarySearchBounds.eq(segments, start); rangeStartIndices.push(idx); do { parallelism[idx]++; idx++; } while (segments[idx] < end); } for (let i = 0; i < this._rangeCallbacks.length; i++) { const start = this._rangePoints[i * 2]; const end = this._rangePoints[i * 2 + 1]; let idx = rangeStartIndices[i]; let sum = 0; let totalDuration = 0; let current = start; do { const p = parallelism[idx]; idx++; const duration = segments[idx] - current; totalDuration += duration; current = segments[idx]; sum += p * duration; } while (current < end); this._rangeCallbacks[i](sum / totalDuration); } } } module.exports = ParallelismFactorCalculator; /***/ }), /***/ 65753: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template T */ class Queue { /** * @param {Iterable=} items The initial elements. */ constructor(items) { /** @private @type {Set} */ this._set = new Set(items); /** @private @type {Iterator} */ this._iterator = this._set[Symbol.iterator](); } /** * Returns the number of elements in this queue. * @returns {number} The number of elements in this queue. */ get length() { return this._set.size; } /** * Appends the specified element to this queue. * @param {T} item The element to add. * @returns {void} */ enqueue(item) { this._set.add(item); } /** * Retrieves and removes the head of this queue. * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty. */ dequeue() { const result = this._iterator.next(); if (result.done) return undefined; this._set.delete(result.value); return result.value; } } module.exports = Queue; /***/ }), /***/ 34715: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * intersect creates Set containing the intersection of elements between all sets * @template T * @param {Set[]} sets an array of sets being checked for shared elements * @returns {Set} returns a new Set containing the intersecting items */ const intersect = sets => { if (sets.length === 0) return new Set(); if (sets.length === 1) return new Set(sets[0]); let minSize = Infinity; let minIndex = -1; for (let i = 0; i < sets.length; i++) { const size = sets[i].size; if (size < minSize) { minIndex = i; minSize = size; } } const current = new Set(sets[minIndex]); for (let i = 0; i < sets.length; i++) { if (i === minIndex) continue; const set = sets[i]; for (const item of current) { if (!set.has(item)) { current.delete(item); } } } return current; }; /** * Checks if a set is the subset of another set * @template T * @param {Set} bigSet a Set which contains the original elements to compare against * @param {Set} smallSet the set whose elements might be contained inside of bigSet * @returns {boolean} returns true if smallSet contains all elements inside of the bigSet */ const isSubset = (bigSet, smallSet) => { if (bigSet.size < smallSet.size) return false; for (const item of smallSet) { if (!bigSet.has(item)) return false; } return true; }; /** * @template T * @param {Set} set a set * @param {function(T): boolean} fn selector function * @returns {T | undefined} found item */ const find = (set, fn) => { for (const item of set) { if (fn(item)) return item; } }; /** * @template T * @param {Set} set a set * @returns {T | undefined} first item */ const first = set => { const entry = set.values().next(); return entry.done ? undefined : entry.value; }; /** * @template T * @param {Set} a first * @param {Set} b second * @returns {Set} combined set, may be identical to a or b */ const combine = (a, b) => { if (b.size === 0) return a; if (a.size === 0) return b; const set = new Set(a); for (const item of b) set.add(item); return set; }; exports.intersect = intersect; exports.isSubset = isSubset; exports.find = find; exports.first = first; exports.combine = combine; /***/ }), /***/ 67563: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const NONE = Symbol("not sorted"); /** * A subset of Set that offers sorting functionality * @template T item type in set * @extends {Set} */ class SortableSet extends Set { /** * Create a new sortable set * @param {Iterable=} initialIterable The initial iterable value * @typedef {function(T, T): number} SortFunction * @param {SortFunction=} defaultSort Default sorting function */ constructor(initialIterable, defaultSort) { super(initialIterable); /** @private @type {undefined | function(T, T): number}} */ this._sortFn = defaultSort; /** @private @type {typeof NONE | undefined | function(T, T): number}} */ this._lastActiveSortFn = NONE; /** @private @type {Map | undefined} */ this._cache = undefined; /** @private @type {Map | undefined} */ this._cacheOrderIndependent = undefined; } /** * @param {T} value value to add to set * @returns {this} returns itself */ add(value) { this._lastActiveSortFn = NONE; this._invalidateCache(); this._invalidateOrderedCache(); super.add(value); return this; } /** * @param {T} value value to delete * @returns {boolean} true if value existed in set, false otherwise */ delete(value) { this._invalidateCache(); this._invalidateOrderedCache(); return super.delete(value); } /** * @returns {void} */ clear() { this._invalidateCache(); this._invalidateOrderedCache(); return super.clear(); } /** * Sort with a comparer function * @param {SortFunction} sortFn Sorting comparer function * @returns {void} */ sortWith(sortFn) { if (this.size <= 1 || sortFn === this._lastActiveSortFn) { // already sorted - nothing to do return; } const sortedArray = Array.from(this).sort(sortFn); super.clear(); for (let i = 0; i < sortedArray.length; i += 1) { super.add(sortedArray[i]); } this._lastActiveSortFn = sortFn; this._invalidateCache(); } sort() { this.sortWith(this._sortFn); return this; } /** * Get data from cache * @template R * @param {function(SortableSet): R} fn function to calculate value * @returns {R} returns result of fn(this), cached until set changes */ getFromCache(fn) { if (this._cache === undefined) { this._cache = new Map(); } else { const result = this._cache.get(fn); const data = /** @type {R} */ (result); if (data !== undefined) { return data; } } const newData = fn(this); this._cache.set(fn, newData); return newData; } /** * Get data from cache (ignoring sorting) * @template R * @param {function(SortableSet): R} fn function to calculate value * @returns {R} returns result of fn(this), cached until set changes */ getFromUnorderedCache(fn) { if (this._cacheOrderIndependent === undefined) { this._cacheOrderIndependent = new Map(); } else { const result = this._cacheOrderIndependent.get(fn); const data = /** @type {R} */ (result); if (data !== undefined) { return data; } } const newData = fn(this); this._cacheOrderIndependent.set(fn, newData); return newData; } /** * @private * @returns {void} */ _invalidateCache() { if (this._cache !== undefined) { this._cache.clear(); } } /** * @private * @returns {void} */ _invalidateOrderedCache() { if (this._cacheOrderIndependent !== undefined) { this._cacheOrderIndependent.clear(); } } /** * @returns {T[]} the raw array */ toJSON() { return Array.from(this); } } module.exports = SortableSet; /***/ }), /***/ 26009: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template K * @template V */ class StackedCacheMap { constructor() { /** @type {Map} */ this.map = new Map(); /** @type {ReadonlyMap[]} */ this.stack = []; } /** * @param {ReadonlyMap} map map to add * @param {boolean} immutable if 'map' is immutable and StackedCacheMap can keep referencing it */ addAll(map, immutable) { if (immutable) { this.stack.push(map); // largest map should go first for (let i = this.stack.length - 1; i > 0; i--) { const beforeLast = this.stack[i - 1]; if (beforeLast.size >= map.size) break; this.stack[i] = beforeLast; this.stack[i - 1] = map; } } else { for (const [key, value] of map) { this.map.set(key, value); } } } /** * @param {K} item the key of the element to add * @param {V} value the value of the element to add * @returns {void} */ set(item, value) { this.map.set(item, value); } /** * @param {K} item the item to delete * @returns {void} */ delete(item) { throw new Error("Items can't be deleted from a StackedCacheMap"); } /** * @param {K} item the item to test * @returns {boolean} true if the item exists in this set */ has(item) { throw new Error( "Checking StackedCacheMap.has before reading is inefficient, use StackedCacheMap.get and check for undefined" ); } /** * @param {K} item the key of the element to return * @returns {V} the value of the element */ get(item) { for (const map of this.stack) { const value = map.get(item); if (value !== undefined) return value; } return this.map.get(item); } clear() { this.stack.length = 0; this.map.clear(); } get size() { let size = this.map.size; for (const map of this.stack) { size += map.size; } return size; } [Symbol.iterator]() { const iterators = this.stack.map(map => map[Symbol.iterator]()); let current = this.map[Symbol.iterator](); return { next() { let result = current.next(); while (result.done && iterators.length > 0) { current = iterators.pop(); result = current.next(); } return result; } }; } } module.exports = StackedCacheMap; /***/ }), /***/ 60798: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const TOMBSTONE = Symbol("tombstone"); const UNDEFINED_MARKER = Symbol("undefined"); /** * @template T * @typedef {T | undefined} Cell */ /** * @template T * @typedef {T | typeof TOMBSTONE | typeof UNDEFINED_MARKER} InternalCell */ /** * @template K * @template V * @param {[K, InternalCell]} pair the internal cell * @returns {[K, Cell]} its “safe” representation */ const extractPair = pair => { const key = pair[0]; const val = pair[1]; if (val === UNDEFINED_MARKER || val === TOMBSTONE) { return [key, undefined]; } else { return /** @type {[K, Cell]} */ (pair); } }; /** * @template K * @template V */ class StackedMap { /** * @param {Map>[]=} parentStack an optional parent */ constructor(parentStack) { /** @type {Map>} */ this.map = new Map(); /** @type {Map>[]} */ this.stack = parentStack === undefined ? [] : parentStack.slice(); this.stack.push(this.map); } /** * @param {K} item the key of the element to add * @param {V} value the value of the element to add * @returns {void} */ set(item, value) { this.map.set(item, value === undefined ? UNDEFINED_MARKER : value); } /** * @param {K} item the item to delete * @returns {void} */ delete(item) { if (this.stack.length > 1) { this.map.set(item, TOMBSTONE); } else { this.map.delete(item); } } /** * @param {K} item the item to test * @returns {boolean} true if the item exists in this set */ has(item) { const topValue = this.map.get(item); if (topValue !== undefined) { return topValue !== TOMBSTONE; } if (this.stack.length > 1) { for (let i = this.stack.length - 2; i >= 0; i--) { const value = this.stack[i].get(item); if (value !== undefined) { this.map.set(item, value); return value !== TOMBSTONE; } } this.map.set(item, TOMBSTONE); } return false; } /** * @param {K} item the key of the element to return * @returns {Cell} the value of the element */ get(item) { const topValue = this.map.get(item); if (topValue !== undefined) { return topValue === TOMBSTONE || topValue === UNDEFINED_MARKER ? undefined : topValue; } if (this.stack.length > 1) { for (let i = this.stack.length - 2; i >= 0; i--) { const value = this.stack[i].get(item); if (value !== undefined) { this.map.set(item, value); return value === TOMBSTONE || value === UNDEFINED_MARKER ? undefined : value; } } this.map.set(item, TOMBSTONE); } return undefined; } _compress() { if (this.stack.length === 1) return; this.map = new Map(); for (const data of this.stack) { for (const pair of data) { if (pair[1] === TOMBSTONE) { this.map.delete(pair[0]); } else { this.map.set(pair[0], pair[1]); } } } this.stack = [this.map]; } asArray() { this._compress(); return Array.from(this.map.keys()); } asSet() { this._compress(); return new Set(this.map.keys()); } asPairArray() { this._compress(); return Array.from(this.map.entries(), extractPair); } asMap() { return new Map(this.asPairArray()); } get size() { this._compress(); return this.map.size; } createChild() { return new StackedMap(this.stack); } } module.exports = StackedMap; /***/ }), /***/ 23877: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ class StringXor { constructor() { this._value = undefined; } /** * @param {string} str string * @returns {void} */ add(str) { const len = str.length; const value = this._value; if (value === undefined) { const newValue = (this._value = Buffer.allocUnsafe(len)); for (let i = 0; i < len; i++) { newValue[i] = str.charCodeAt(i); } return; } const valueLen = value.length; if (valueLen < len) { const newValue = (this._value = Buffer.allocUnsafe(len)); let i; for (i = 0; i < valueLen; i++) { newValue[i] = value[i] ^ str.charCodeAt(i); } for (; i < len; i++) { newValue[i] = str.charCodeAt(i); } } else { for (let i = 0; i < len; i++) { value[i] = value[i] ^ str.charCodeAt(i); } } } toString() { const value = this._value; return value === undefined ? "" : value.toString("latin1"); } updateHash(hash) { const value = this._value; if (value !== undefined) hash.update(value); } } module.exports = StringXor; /***/ }), /***/ 54345: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const TupleSet = __webpack_require__(39322); /** * @template {any[]} T */ class TupleQueue { /** * @param {Iterable=} items The initial elements. */ constructor(items) { /** @private @type {TupleSet} */ this._set = new TupleSet(items); /** @private @type {Iterator} */ this._iterator = this._set[Symbol.iterator](); } /** * Returns the number of elements in this queue. * @returns {number} The number of elements in this queue. */ get length() { return this._set.size; } /** * Appends the specified element to this queue. * @param {T} item The element to add. * @returns {void} */ enqueue(...item) { this._set.add(...item); } /** * Retrieves and removes the head of this queue. * @returns {T | undefined} The head of the queue of `undefined` if this queue is empty. */ dequeue() { const result = this._iterator.next(); if (result.done) { if (this._set.size > 0) { this._iterator = this._set[Symbol.iterator](); const value = this._iterator.next().value; this._set.delete(...value); return value; } return undefined; } this._set.delete(...result.value); return result.value; } } module.exports = TupleQueue; /***/ }), /***/ 39322: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template {any[]} T */ class TupleSet { constructor(init) { this._map = new Map(); this.size = 0; if (init) { for (const tuple of init) { this.add(...tuple); } } } /** * @param {T} args tuple * @returns {void} */ add(...args) { let map = this._map; for (let i = 0; i < args.length - 2; i++) { const arg = args[i]; const innerMap = map.get(arg); if (innerMap === undefined) { map.set(arg, (map = new Map())); } else { map = innerMap; } } const beforeLast = args[args.length - 2]; let set = map.get(beforeLast); if (set === undefined) { map.set(beforeLast, (set = new Set())); } const last = args[args.length - 1]; this.size -= set.size; set.add(last); this.size += set.size; } /** * @param {T} args tuple * @returns {boolean} true, if the tuple is in the Set */ has(...args) { let map = this._map; for (let i = 0; i < args.length - 2; i++) { const arg = args[i]; map = map.get(arg); if (map === undefined) { return false; } } const beforeLast = args[args.length - 2]; let set = map.get(beforeLast); if (set === undefined) { return false; } const last = args[args.length - 1]; return set.has(last); } /** * @param {T} args tuple * @returns {void} */ delete(...args) { let map = this._map; for (let i = 0; i < args.length - 2; i++) { const arg = args[i]; map = map.get(arg); if (map === undefined) { return; } } const beforeLast = args[args.length - 2]; let set = map.get(beforeLast); if (set === undefined) { return; } const last = args[args.length - 1]; this.size -= set.size; set.delete(last); this.size += set.size; } /** * @returns {Iterator} iterator */ [Symbol.iterator]() { const iteratorStack = []; const tuple = []; let currentSetIterator = undefined; const next = it => { const result = it.next(); if (result.done) { if (iteratorStack.length === 0) return false; tuple.pop(); return next(iteratorStack.pop()); } const [key, value] = result.value; iteratorStack.push(it); tuple.push(key); if (value instanceof Set) { currentSetIterator = value[Symbol.iterator](); return true; } else { return next(value[Symbol.iterator]()); } }; next(this._map[Symbol.iterator]()); return { next() { while (currentSetIterator) { const result = currentSetIterator.next(); if (result.done) { tuple.pop(); if (!next(iteratorStack.pop())) { currentSetIterator = undefined; } } else { return { done: false, value: /** @type {T} */ (tuple.concat(result.value)) }; } } return { done: true, value: undefined }; } }; } } module.exports = TupleSet; /***/ }), /***/ 49606: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ /** @typedef {import("./fs").InputFileSystem} InputFileSystem */ /** @typedef {(error: Error|null, result?: Buffer) => void} ErrorFirstCallback */ const backSlashCharCode = "\\".charCodeAt(0); const slashCharCode = "/".charCodeAt(0); const aLowerCaseCharCode = "a".charCodeAt(0); const zLowerCaseCharCode = "z".charCodeAt(0); const aUpperCaseCharCode = "A".charCodeAt(0); const zUpperCaseCharCode = "Z".charCodeAt(0); const _0CharCode = "0".charCodeAt(0); const _9CharCode = "9".charCodeAt(0); const plusCharCode = "+".charCodeAt(0); const hyphenCharCode = "-".charCodeAt(0); const colonCharCode = ":".charCodeAt(0); const hashCharCode = "#".charCodeAt(0); const queryCharCode = "?".charCodeAt(0); /** * Get scheme if specifier is an absolute URL specifier * e.g. Absolute specifiers like 'file:///user/webpack/index.js' * https://tools.ietf.org/html/rfc3986#section-3.1 * @param {string} specifier specifier * @returns {string|undefined} scheme if absolute URL specifier provided */ function getScheme(specifier) { const start = specifier.charCodeAt(0); // First char maybe only a letter if ( (start < aLowerCaseCharCode || start > zLowerCaseCharCode) && (start < aUpperCaseCharCode || start > zUpperCaseCharCode) ) { return undefined; } let i = 1; let ch = specifier.charCodeAt(i); while ( (ch >= aLowerCaseCharCode && ch <= zLowerCaseCharCode) || (ch >= aUpperCaseCharCode && ch <= zUpperCaseCharCode) || (ch >= _0CharCode && ch <= _9CharCode) || ch === plusCharCode || ch === hyphenCharCode ) { if (++i === specifier.length) return undefined; ch = specifier.charCodeAt(i); } // Scheme must end with colon if (ch !== colonCharCode) return undefined; // Check for Windows absolute path // https://url.spec.whatwg.org/#url-miscellaneous if (i === 1) { const nextChar = i + 1 < specifier.length ? specifier.charCodeAt(i + 1) : 0; if ( nextChar === 0 || nextChar === backSlashCharCode || nextChar === slashCharCode || nextChar === hashCharCode || nextChar === queryCharCode ) { return undefined; } } return specifier.slice(0, i).toLowerCase(); } /** * @param {string} specifier specifier * @returns {string|null} protocol if absolute URL specifier provided */ function getProtocol(specifier) { const scheme = getScheme(specifier); return scheme === undefined ? undefined : scheme + ":"; } exports.getScheme = getScheme; exports.getProtocol = getProtocol; /***/ }), /***/ 73963: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const isWeakKey = thing => typeof thing === "object" && thing !== null; /** * @template {any[]} T * @template V */ class WeakTupleMap { constructor() { /** @private */ this.f = 0; /** @private @type {any} */ this.v = undefined; /** @private @type {Map> | undefined} */ this.m = undefined; /** @private @type {WeakMap> | undefined} */ this.w = undefined; } /** * @param {[...T, V]} args tuple * @returns {void} */ set(...args) { /** @type {WeakTupleMap} */ let node = this; for (let i = 0; i < args.length - 1; i++) { node = node._get(args[i]); } node._setValue(args[args.length - 1]); } /** * @param {T} args tuple * @returns {boolean} true, if the tuple is in the Set */ has(...args) { /** @type {WeakTupleMap} */ let node = this; for (let i = 0; i < args.length; i++) { node = node._peek(args[i]); if (node === undefined) return false; } return node._hasValue(); } /** * @param {T} args tuple * @returns {V} the value */ get(...args) { /** @type {WeakTupleMap} */ let node = this; for (let i = 0; i < args.length; i++) { node = node._peek(args[i]); if (node === undefined) return undefined; } return node._getValue(); } /** * @param {[...T, function(): V]} args tuple * @returns {V} the value */ provide(...args) { /** @type {WeakTupleMap} */ let node = this; for (let i = 0; i < args.length - 1; i++) { node = node._get(args[i]); } if (node._hasValue()) return node._getValue(); const fn = args[args.length - 1]; const newValue = fn(...args.slice(0, -1)); node._setValue(newValue); return newValue; } /** * @param {T} args tuple * @returns {void} */ delete(...args) { /** @type {WeakTupleMap} */ let node = this; for (let i = 0; i < args.length; i++) { node = node._peek(args[i]); if (node === undefined) return; } node._deleteValue(); } /** * @returns {void} */ clear() { this.f = 0; this.v = undefined; this.w = undefined; this.m = undefined; } _getValue() { return this.v; } _hasValue() { return (this.f & 1) === 1; } _setValue(v) { this.f |= 1; this.v = v; } _deleteValue() { this.f &= 6; this.v = undefined; } _peek(thing) { if (isWeakKey(thing)) { if ((this.f & 4) !== 4) return undefined; return this.w.get(thing); } else { if ((this.f & 2) !== 2) return undefined; return this.m.get(thing); } } _get(thing) { if (isWeakKey(thing)) { if ((this.f & 4) !== 4) { const newMap = new WeakMap(); this.f |= 4; const newNode = new WeakTupleMap(); (this.w = newMap).set(thing, newNode); return newNode; } const entry = this.w.get(thing); if (entry !== undefined) { return entry; } const newNode = new WeakTupleMap(); this.w.set(thing, newNode); return newNode; } else { if ((this.f & 2) !== 2) { const newMap = new Map(); this.f |= 2; const newNode = new WeakTupleMap(); (this.m = newMap).set(thing, newNode); return newNode; } const entry = this.m.get(thing); if (entry !== undefined) { return entry; } const newNode = new WeakTupleMap(); this.m.set(thing, newNode); return newNode; } } } module.exports = WeakTupleMap; /***/ }), /***/ 44795: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Mikola Lysenko @mikolalysenko */ /* cspell:disable-next-line */ // Refactor: Peter Somogyvari @petermetz const compileSearch = (funcName, predicate, reversed, extraArgs, earlyOut) => { const code = [ "function ", funcName, "(a,l,h,", extraArgs.join(","), "){", earlyOut ? "" : "var i=", reversed ? "l-1" : "h+1", ";while(l<=h){var m=(l+h)>>>1,x=a[m]" ]; if (earlyOut) { if (predicate.indexOf("c") < 0) { code.push(";if(x===y){return m}else if(x<=y){"); } else { code.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"); } } else { code.push(";if(", predicate, "){i=m;"); } if (reversed) { code.push("l=m+1}else{h=m-1}"); } else { code.push("h=m-1}else{l=m+1}"); } code.push("}"); if (earlyOut) { code.push("return -1};"); } else { code.push("return i};"); } return code.join(""); }; const compileBoundsSearch = (predicate, reversed, suffix, earlyOut) => { const arg1 = compileSearch( "A", "x" + predicate + "y", reversed, ["y"], earlyOut ); const arg2 = compileSearch( "P", "c(x,y)" + predicate + "0", reversed, ["y", "c"], earlyOut ); const fnHeader = "function dispatchBinarySearch"; const fnBody = "(a,y,c,l,h){\ if(typeof(c)==='function'){\ return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)\ }else{\ return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)\ }}\ return dispatchBinarySearch"; const fnArgList = [arg1, arg2, fnHeader, suffix, fnBody, suffix]; const fnSource = fnArgList.join(""); const result = new Function(fnSource); return result(); }; module.exports = { ge: compileBoundsSearch(">=", false, "GE"), gt: compileBoundsSearch(">", false, "GT"), lt: compileBoundsSearch("<", true, "LT"), le: compileBoundsSearch("<=", true, "LE"), eq: compileBoundsSearch("-", true, "EQ", true) }; /***/ }), /***/ 11217: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @type {WeakMap>} */ const mergeCache = new WeakMap(); /** @type {WeakMap>>} */ const setPropertyCache = new WeakMap(); const DELETE = Symbol("DELETE"); const DYNAMIC_INFO = Symbol("cleverMerge dynamic info"); /** * Merges two given objects and caches the result to avoid computation if same objects passed as arguments again. * @template T * @template O * @example * // performs cleverMerge(first, second), stores the result in WeakMap and returns result * cachedCleverMerge({a: 1}, {a: 2}) * {a: 2} * // when same arguments passed, gets the result from WeakMap and returns it. * cachedCleverMerge({a: 1}, {a: 2}) * {a: 2} * @param {T} first first object * @param {O} second second object * @returns {T & O | T | O} merged object of first and second object */ const cachedCleverMerge = (first, second) => { if (second === undefined) return first; if (first === undefined) return second; if (typeof second !== "object" || second === null) return second; if (typeof first !== "object" || first === null) return first; let innerCache = mergeCache.get(first); if (innerCache === undefined) { innerCache = new WeakMap(); mergeCache.set(first, innerCache); } const prevMerge = innerCache.get(second); if (prevMerge !== undefined) return prevMerge; const newMerge = _cleverMerge(first, second, true); innerCache.set(second, newMerge); return newMerge; }; /** * @template T * @param {Partial} obj object * @param {string} property property * @param {string|number|boolean} value assignment value * @returns {T} new object */ const cachedSetProperty = (obj, property, value) => { let mapByProperty = setPropertyCache.get(obj); if (mapByProperty === undefined) { mapByProperty = new Map(); setPropertyCache.set(obj, mapByProperty); } let mapByValue = mapByProperty.get(property); if (mapByValue === undefined) { mapByValue = new Map(); mapByProperty.set(property, mapByValue); } let result = mapByValue.get(value); if (result) return result; result = { ...obj, [property]: value }; mapByValue.set(value, result); return result; }; /** * @typedef {Object} ObjectParsedPropertyEntry * @property {any | undefined} base base value * @property {string | undefined} byProperty the name of the selector property * @property {Map} byValues value depending on selector property, merged with base */ /** * @typedef {Object} ParsedObject * @property {Map} static static properties (key is property name) * @property {{ byProperty: string, fn: Function } | undefined} dynamic dynamic part */ /** @type {WeakMap} */ const parseCache = new WeakMap(); /** * @param {object} obj the object * @returns {ParsedObject} parsed object */ const cachedParseObject = obj => { const entry = parseCache.get(obj); if (entry !== undefined) return entry; const result = parseObject(obj); parseCache.set(obj, result); return result; }; /** * @param {object} obj the object * @returns {ParsedObject} parsed object */ const parseObject = obj => { const info = new Map(); let dynamicInfo; const getInfo = p => { const entry = info.get(p); if (entry !== undefined) return entry; const newEntry = { base: undefined, byProperty: undefined, byValues: undefined }; info.set(p, newEntry); return newEntry; }; for (const key of Object.keys(obj)) { if (key.startsWith("by")) { const byProperty = key; const byObj = obj[byProperty]; if (typeof byObj === "object") { for (const byValue of Object.keys(byObj)) { const obj = byObj[byValue]; for (const key of Object.keys(obj)) { const entry = getInfo(key); if (entry.byProperty === undefined) { entry.byProperty = byProperty; entry.byValues = new Map(); } else if (entry.byProperty !== byProperty) { throw new Error( `${byProperty} and ${entry.byProperty} for a single property is not supported` ); } entry.byValues.set(byValue, obj[key]); if (byValue === "default") { for (const otherByValue of Object.keys(byObj)) { if (!entry.byValues.has(otherByValue)) entry.byValues.set(otherByValue, undefined); } } } } } else if (typeof byObj === "function") { if (dynamicInfo === undefined) { dynamicInfo = { byProperty: key, fn: byObj }; } else { throw new Error( `${key} and ${dynamicInfo.byProperty} when both are functions is not supported` ); } } else { const entry = getInfo(key); entry.base = obj[key]; } } else { const entry = getInfo(key); entry.base = obj[key]; } } return { static: info, dynamic: dynamicInfo }; }; /** * @param {Map} info static properties (key is property name) * @param {{ byProperty: string, fn: Function } | undefined} dynamicInfo dynamic part * @returns {object} the object */ const serializeObject = (info, dynamicInfo) => { const obj = {}; // Setup byProperty structure for (const entry of info.values()) { if (entry.byProperty !== undefined) { const byObj = (obj[entry.byProperty] = obj[entry.byProperty] || {}); for (const byValue of entry.byValues.keys()) { byObj[byValue] = byObj[byValue] || {}; } } } for (const [key, entry] of info) { if (entry.base !== undefined) { obj[key] = entry.base; } // Fill byProperty structure if (entry.byProperty !== undefined) { const byObj = (obj[entry.byProperty] = obj[entry.byProperty] || {}); for (const byValue of Object.keys(byObj)) { const value = getFromByValues(entry.byValues, byValue); if (value !== undefined) byObj[byValue][key] = value; } } } if (dynamicInfo !== undefined) { obj[dynamicInfo.byProperty] = dynamicInfo.fn; } return obj; }; const VALUE_TYPE_UNDEFINED = 0; const VALUE_TYPE_ATOM = 1; const VALUE_TYPE_ARRAY_EXTEND = 2; const VALUE_TYPE_OBJECT = 3; const VALUE_TYPE_DELETE = 4; /** * @param {any} value a single value * @returns {VALUE_TYPE_UNDEFINED | VALUE_TYPE_ATOM | VALUE_TYPE_ARRAY_EXTEND | VALUE_TYPE_OBJECT | VALUE_TYPE_DELETE} value type */ const getValueType = value => { if (value === undefined) { return VALUE_TYPE_UNDEFINED; } else if (value === DELETE) { return VALUE_TYPE_DELETE; } else if (Array.isArray(value)) { if (value.lastIndexOf("...") !== -1) return VALUE_TYPE_ARRAY_EXTEND; return VALUE_TYPE_ATOM; } else if ( typeof value === "object" && value !== null && (!value.constructor || value.constructor === Object) ) { return VALUE_TYPE_OBJECT; } return VALUE_TYPE_ATOM; }; /** * Merges two objects. Objects are deeply clever merged. * Arrays might reference the old value with "...". * Non-object values take preference over object values. * @template T * @template O * @param {T} first first object * @param {O} second second object * @returns {T & O | T | O} merged object of first and second object */ const cleverMerge = (first, second) => { if (second === undefined) return first; if (first === undefined) return second; if (typeof second !== "object" || second === null) return second; if (typeof first !== "object" || first === null) return first; return _cleverMerge(first, second, false); }; /** * Merges two objects. Objects are deeply clever merged. * @param {object} first first object * @param {object} second second object * @param {boolean} internalCaching should parsing of objects and nested merges be cached * @returns {object} merged object of first and second object */ const _cleverMerge = (first, second, internalCaching = false) => { const firstObject = internalCaching ? cachedParseObject(first) : parseObject(first); const { static: firstInfo, dynamic: firstDynamicInfo } = firstObject; // If the first argument has a dynamic part we modify the dynamic part to merge the second argument if (firstDynamicInfo !== undefined) { let { byProperty, fn } = firstDynamicInfo; const fnInfo = fn[DYNAMIC_INFO]; if (fnInfo) { second = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second); fn = fnInfo[0]; } const newFn = (...args) => { const fnResult = fn(...args); return internalCaching ? cachedCleverMerge(fnResult, second) : cleverMerge(fnResult, second); }; newFn[DYNAMIC_INFO] = [fn, second]; return serializeObject(firstObject.static, { byProperty, fn: newFn }); } // If the first part is static only, we merge the static parts and keep the dynamic part of the second argument const secondObject = internalCaching ? cachedParseObject(second) : parseObject(second); const { static: secondInfo, dynamic: secondDynamicInfo } = secondObject; /** @type {Map} */ const resultInfo = new Map(); for (const [key, firstEntry] of firstInfo) { const secondEntry = secondInfo.get(key); const entry = secondEntry !== undefined ? mergeEntries(firstEntry, secondEntry, internalCaching) : firstEntry; resultInfo.set(key, entry); } for (const [key, secondEntry] of secondInfo) { if (!firstInfo.has(key)) { resultInfo.set(key, secondEntry); } } return serializeObject(resultInfo, secondDynamicInfo); }; /** * @param {ObjectParsedPropertyEntry} firstEntry a * @param {ObjectParsedPropertyEntry} secondEntry b * @param {boolean} internalCaching should parsing of objects and nested merges be cached * @returns {ObjectParsedPropertyEntry} new entry */ const mergeEntries = (firstEntry, secondEntry, internalCaching) => { switch (getValueType(secondEntry.base)) { case VALUE_TYPE_ATOM: case VALUE_TYPE_DELETE: // No need to consider firstEntry at all // second value override everything // = second.base + second.byProperty return secondEntry; case VALUE_TYPE_UNDEFINED: if (!firstEntry.byProperty) { // = first.base + second.byProperty return { base: firstEntry.base, byProperty: secondEntry.byProperty, byValues: secondEntry.byValues }; } else if (firstEntry.byProperty !== secondEntry.byProperty) { throw new Error( `${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported` ); } else { // = first.base + (first.byProperty + second.byProperty) // need to merge first and second byValues const newByValues = new Map(firstEntry.byValues); for (const [key, value] of secondEntry.byValues) { const firstValue = getFromByValues(firstEntry.byValues, key); newByValues.set( key, mergeSingleValue(firstValue, value, internalCaching) ); } return { base: firstEntry.base, byProperty: firstEntry.byProperty, byValues: newByValues }; } default: { if (!firstEntry.byProperty) { // The simple case // = (first.base + second.base) + second.byProperty return { base: mergeSingleValue( firstEntry.base, secondEntry.base, internalCaching ), byProperty: secondEntry.byProperty, byValues: secondEntry.byValues }; } let newBase; const intermediateByValues = new Map(firstEntry.byValues); for (const [key, value] of intermediateByValues) { intermediateByValues.set( key, mergeSingleValue(value, secondEntry.base, internalCaching) ); } if ( Array.from(firstEntry.byValues.values()).every(value => { const type = getValueType(value); return type === VALUE_TYPE_ATOM || type === VALUE_TYPE_DELETE; }) ) { // = (first.base + second.base) + ((first.byProperty + second.base) + second.byProperty) newBase = mergeSingleValue( firstEntry.base, secondEntry.base, internalCaching ); } else { // = first.base + ((first.byProperty (+default) + second.base) + second.byProperty) newBase = firstEntry.base; if (!intermediateByValues.has("default")) intermediateByValues.set("default", secondEntry.base); } if (!secondEntry.byProperty) { // = first.base + (first.byProperty + second.base) return { base: newBase, byProperty: firstEntry.byProperty, byValues: intermediateByValues }; } else if (firstEntry.byProperty !== secondEntry.byProperty) { throw new Error( `${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported` ); } const newByValues = new Map(intermediateByValues); for (const [key, value] of secondEntry.byValues) { const firstValue = getFromByValues(intermediateByValues, key); newByValues.set( key, mergeSingleValue(firstValue, value, internalCaching) ); } return { base: newBase, byProperty: firstEntry.byProperty, byValues: newByValues }; } } }; /** * @param {Map} byValues all values * @param {string} key value of the selector * @returns {any | undefined} value */ const getFromByValues = (byValues, key) => { if (key !== "default" && byValues.has(key)) { return byValues.get(key); } return byValues.get("default"); }; /** * @param {any} a value * @param {any} b value * @param {boolean} internalCaching should parsing of objects and nested merges be cached * @returns {any} value */ const mergeSingleValue = (a, b, internalCaching) => { const bType = getValueType(b); const aType = getValueType(a); switch (bType) { case VALUE_TYPE_DELETE: case VALUE_TYPE_ATOM: return b; case VALUE_TYPE_OBJECT: { return aType !== VALUE_TYPE_OBJECT ? b : internalCaching ? cachedCleverMerge(a, b) : cleverMerge(a, b); } case VALUE_TYPE_UNDEFINED: return a; case VALUE_TYPE_ARRAY_EXTEND: switch ( aType !== VALUE_TYPE_ATOM ? aType : Array.isArray(a) ? VALUE_TYPE_ARRAY_EXTEND : VALUE_TYPE_OBJECT ) { case VALUE_TYPE_UNDEFINED: return b; case VALUE_TYPE_DELETE: return b.filter(item => item !== "..."); case VALUE_TYPE_ARRAY_EXTEND: { const newArray = []; for (const item of b) { if (item === "...") { for (const item of a) { newArray.push(item); } } else { newArray.push(item); } } return newArray; } case VALUE_TYPE_OBJECT: return b.map(item => (item === "..." ? a : item)); default: throw new Error("Not implemented"); } default: throw new Error("Not implemented"); } }; /** * @template T * @param {T} obj the object * @returns {T} the object without operations like "..." or DELETE */ const removeOperations = obj => { const newObj = /** @type {T} */ ({}); for (const key of Object.keys(obj)) { const value = obj[key]; const type = getValueType(value); switch (type) { case VALUE_TYPE_UNDEFINED: case VALUE_TYPE_DELETE: break; case VALUE_TYPE_OBJECT: newObj[key] = removeOperations(value); break; case VALUE_TYPE_ARRAY_EXTEND: newObj[key] = value.filter(i => i !== "..."); break; default: newObj[key] = value; break; } } return newObj; }; /** * @template T * @template {string} P * @param {T} obj the object * @param {P} byProperty the by description * @param {...any} values values * @returns {Omit} object with merged byProperty */ const resolveByProperty = (obj, byProperty, ...values) => { if (typeof obj !== "object" || obj === null || !(byProperty in obj)) { return obj; } const { [byProperty]: _byValue, ..._remaining } = /** @type {object} */ (obj); const remaining = /** @type {T} */ (_remaining); const byValue = /** @type {Record | function(...any[]): T} */ ( _byValue ); if (typeof byValue === "object") { const key = values[0]; if (key in byValue) { return cachedCleverMerge(remaining, byValue[key]); } else if ("default" in byValue) { return cachedCleverMerge(remaining, byValue.default); } else { return /** @type {T} */ (remaining); } } else if (typeof byValue === "function") { const result = byValue.apply(null, values); return cachedCleverMerge( remaining, resolveByProperty(result, byProperty, ...values) ); } }; exports.cachedSetProperty = cachedSetProperty; exports.cachedCleverMerge = cachedCleverMerge; exports.cleverMerge = cleverMerge; exports.resolveByProperty = resolveByProperty; exports.removeOperations = removeOperations; exports.DELETE = DELETE; /***/ }), /***/ 26296: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { compareRuntime } = __webpack_require__(19655); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @template T @typedef {function(T, T): -1|0|1} Comparator */ /** @template TArg @template T @typedef {function(TArg, T, T): -1|0|1} RawParameterizedComparator */ /** @template TArg @template T @typedef {function(TArg): Comparator} ParameterizedComparator */ /** * @template T * @param {RawParameterizedComparator} fn comparator with argument * @returns {ParameterizedComparator} comparator */ const createCachedParameterizedComparator = fn => { /** @type {WeakMap>} */ const map = new WeakMap(); return arg => { const cachedResult = map.get(arg); if (cachedResult !== undefined) return cachedResult; /** * @param {T} a first item * @param {T} b second item * @returns {-1|0|1} compare result */ const result = fn.bind(null, arg); map.set(arg, result); return result; }; }; /** * @param {Chunk} a chunk * @param {Chunk} b chunk * @returns {-1|0|1} compare result */ exports.compareChunksById = (a, b) => { return compareIds(a.id, b.id); }; /** * @param {Module} a module * @param {Module} b module * @returns {-1|0|1} compare result */ exports.compareModulesByIdentifier = (a, b) => { return compareIds(a.identifier(), b.identifier()); }; /** * @param {ChunkGraph} chunkGraph the chunk graph * @param {Module} a module * @param {Module} b module * @returns {-1|0|1} compare result */ const compareModulesById = (chunkGraph, a, b) => { return compareIds(chunkGraph.getModuleId(a), chunkGraph.getModuleId(b)); }; /** @type {ParameterizedComparator} */ exports.compareModulesById = createCachedParameterizedComparator(compareModulesById); /** * @param {number} a number * @param {number} b number * @returns {-1|0|1} compare result */ const compareNumbers = (a, b) => { if (typeof a !== typeof b) { return typeof a < typeof b ? -1 : 1; } if (a < b) return -1; if (a > b) return 1; return 0; }; exports.compareNumbers = compareNumbers; /** * @param {string} a string * @param {string} b string * @returns {-1|0|1} compare result */ const compareStringsNumeric = (a, b) => { const partsA = a.split(/(\d+)/); const partsB = b.split(/(\d+)/); const len = Math.min(partsA.length, partsB.length); for (let i = 0; i < len; i++) { const pA = partsA[i]; const pB = partsB[i]; if (i % 2 === 0) { if (pA.length > pB.length) { if (pA.slice(0, pB.length) > pB) return 1; return -1; } else if (pB.length > pA.length) { if (pB.slice(0, pA.length) > pA) return -1; return 1; } else { if (pA < pB) return -1; if (pA > pB) return 1; } } else { const nA = +pA; const nB = +pB; if (nA < nB) return -1; if (nA > nB) return 1; } } if (partsB.length < partsA.length) return 1; if (partsB.length > partsA.length) return -1; return 0; }; exports.compareStringsNumeric = compareStringsNumeric; /** * @param {ModuleGraph} moduleGraph the module graph * @param {Module} a module * @param {Module} b module * @returns {-1|0|1} compare result */ const compareModulesByPostOrderIndexOrIdentifier = (moduleGraph, a, b) => { const cmp = compareNumbers( moduleGraph.getPostOrderIndex(a), moduleGraph.getPostOrderIndex(b) ); if (cmp !== 0) return cmp; return compareIds(a.identifier(), b.identifier()); }; /** @type {ParameterizedComparator} */ exports.compareModulesByPostOrderIndexOrIdentifier = createCachedParameterizedComparator( compareModulesByPostOrderIndexOrIdentifier ); /** * @param {ModuleGraph} moduleGraph the module graph * @param {Module} a module * @param {Module} b module * @returns {-1|0|1} compare result */ const compareModulesByPreOrderIndexOrIdentifier = (moduleGraph, a, b) => { const cmp = compareNumbers( moduleGraph.getPreOrderIndex(a), moduleGraph.getPreOrderIndex(b) ); if (cmp !== 0) return cmp; return compareIds(a.identifier(), b.identifier()); }; /** @type {ParameterizedComparator} */ exports.compareModulesByPreOrderIndexOrIdentifier = createCachedParameterizedComparator( compareModulesByPreOrderIndexOrIdentifier ); /** * @param {ChunkGraph} chunkGraph the chunk graph * @param {Module} a module * @param {Module} b module * @returns {-1|0|1} compare result */ const compareModulesByIdOrIdentifier = (chunkGraph, a, b) => { const cmp = compareIds(chunkGraph.getModuleId(a), chunkGraph.getModuleId(b)); if (cmp !== 0) return cmp; return compareIds(a.identifier(), b.identifier()); }; /** @type {ParameterizedComparator} */ exports.compareModulesByIdOrIdentifier = createCachedParameterizedComparator( compareModulesByIdOrIdentifier ); /** * @param {ChunkGraph} chunkGraph the chunk graph * @param {Chunk} a chunk * @param {Chunk} b chunk * @returns {-1|0|1} compare result */ const compareChunks = (chunkGraph, a, b) => { return chunkGraph.compareChunks(a, b); }; /** @type {ParameterizedComparator} */ exports.compareChunks = createCachedParameterizedComparator(compareChunks); /** * @param {string|number} a first id * @param {string|number} b second id * @returns {-1|0|1} compare result */ const compareIds = (a, b) => { if (typeof a !== typeof b) { return typeof a < typeof b ? -1 : 1; } if (a < b) return -1; if (a > b) return 1; return 0; }; exports.compareIds = compareIds; /** * @param {string} a first string * @param {string} b second string * @returns {-1|0|1} compare result */ const compareStrings = (a, b) => { if (a < b) return -1; if (a > b) return 1; return 0; }; exports.compareStrings = compareStrings; /** * @param {ChunkGroup} a first chunk group * @param {ChunkGroup} b second chunk group * @returns {-1|0|1} compare result */ const compareChunkGroupsByIndex = (a, b) => { return a.index < b.index ? -1 : 1; }; exports.compareChunkGroupsByIndex = compareChunkGroupsByIndex; /** * @template K1 {Object} * @template K2 * @template T */ class TwoKeyWeakMap { constructor() { /** @private @type {WeakMap>} */ this._map = new WeakMap(); } /** * @param {K1} key1 first key * @param {K2} key2 second key * @returns {T | undefined} value */ get(key1, key2) { const childMap = this._map.get(key1); if (childMap === undefined) { return undefined; } return childMap.get(key2); } /** * @param {K1} key1 first key * @param {K2} key2 second key * @param {T | undefined} value new value * @returns {void} */ set(key1, key2, value) { let childMap = this._map.get(key1); if (childMap === undefined) { childMap = new WeakMap(); this._map.set(key1, childMap); } childMap.set(key2, value); } } /** @type {TwoKeyWeakMap, Comparator, Comparator>}} */ const concatComparatorsCache = new TwoKeyWeakMap(); /** * @template T * @param {Comparator} c1 comparator * @param {Comparator} c2 comparator * @param {Comparator[]} cRest comparators * @returns {Comparator} comparator */ const concatComparators = (c1, c2, ...cRest) => { if (cRest.length > 0) { const [c3, ...cRest2] = cRest; return concatComparators(c1, concatComparators(c2, c3, ...cRest2)); } const cacheEntry = /** @type {Comparator} */ ( concatComparatorsCache.get(c1, c2) ); if (cacheEntry !== undefined) return cacheEntry; /** * @param {T} a first value * @param {T} b second value * @returns {-1|0|1} compare result */ const result = (a, b) => { const res = c1(a, b); if (res !== 0) return res; return c2(a, b); }; concatComparatorsCache.set(c1, c2, result); return result; }; exports.concatComparators = concatComparators; /** @template A, B @typedef {(input: A) => B} Selector */ /** @type {TwoKeyWeakMap, Comparator, Comparator>}} */ const compareSelectCache = new TwoKeyWeakMap(); /** * @template T * @template R * @param {Selector} getter getter for value * @param {Comparator} comparator comparator * @returns {Comparator} comparator */ const compareSelect = (getter, comparator) => { const cacheEntry = compareSelectCache.get(getter, comparator); if (cacheEntry !== undefined) return cacheEntry; /** * @param {T} a first value * @param {T} b second value * @returns {-1|0|1} compare result */ const result = (a, b) => { const aValue = getter(a); const bValue = getter(b); if (aValue !== undefined && aValue !== null) { if (bValue !== undefined && bValue !== null) { return comparator(aValue, bValue); } return -1; } else { if (bValue !== undefined && bValue !== null) { return 1; } return 0; } }; compareSelectCache.set(getter, comparator, result); return result; }; exports.compareSelect = compareSelect; /** @type {WeakMap, Comparator>>} */ const compareIteratorsCache = new WeakMap(); /** * @template T * @param {Comparator} elementComparator comparator for elements * @returns {Comparator>} comparator for iterables of elements */ const compareIterables = elementComparator => { const cacheEntry = compareIteratorsCache.get(elementComparator); if (cacheEntry !== undefined) return cacheEntry; /** * @param {Iterable} a first value * @param {Iterable} b second value * @returns {-1|0|1} compare result */ const result = (a, b) => { const aI = a[Symbol.iterator](); const bI = b[Symbol.iterator](); // eslint-disable-next-line no-constant-condition while (true) { const aItem = aI.next(); const bItem = bI.next(); if (aItem.done) { return bItem.done ? 0 : -1; } else if (bItem.done) { return 1; } const res = elementComparator(aItem.value, bItem.value); if (res !== 0) return res; } }; compareIteratorsCache.set(elementComparator, result); return result; }; exports.compareIterables = compareIterables; // TODO this is no longer needed when minimum node.js version is >= 12 // since these versions ship with a stable sort function /** * @template T * @param {Iterable} iterable original ordered list * @returns {Comparator} comparator */ exports.keepOriginalOrder = iterable => { /** @type {Map} */ const map = new Map(); let i = 0; for (const item of iterable) { map.set(item, i++); } return (a, b) => compareNumbers(map.get(a), map.get(b)); }; /** * @param {ChunkGraph} chunkGraph the chunk graph * @returns {Comparator} comparator */ exports.compareChunksNatural = chunkGraph => { const cmpFn = exports.compareModulesById(chunkGraph); const cmpIterableFn = compareIterables(cmpFn); return concatComparators( compareSelect(chunk => chunk.name, compareIds), compareSelect(chunk => chunk.runtime, compareRuntime), compareSelect( /** * @param {Chunk} chunk a chunk * @returns {Iterable} modules */ chunk => chunkGraph.getOrderedChunkModulesIterable(chunk, cmpFn), cmpIterableFn ) ); }; /** * Compare two locations * @param {DependencyLocation} a A location node * @param {DependencyLocation} b A location node * @returns {-1|0|1} sorting comparator value */ exports.compareLocations = (a, b) => { let isObjectA = typeof a === "object" && a !== null; let isObjectB = typeof b === "object" && b !== null; if (!isObjectA || !isObjectB) { if (isObjectA) return 1; if (isObjectB) return -1; return 0; } if ("start" in a) { if ("start" in b) { const ap = a.start; const bp = b.start; if (ap.line < bp.line) return -1; if (ap.line > bp.line) return 1; if (ap.column < bp.column) return -1; if (ap.column > bp.column) return 1; } else return -1; } else if ("start" in b) return 1; if ("name" in a) { if ("name" in b) { if (a.name < b.name) return -1; if (a.name > b.name) return 1; } else return -1; } else if ("name" in b) return 1; if ("index" in a) { if ("index" in b) { if (a.index < b.index) return -1; if (a.index > b.index) return 1; } else return -1; } else if ("index" in b) return 1; return 0; }; /***/ }), /***/ 356: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const quoteMeta = str => { return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); }; const toSimpleString = str => { if (`${+str}` === str) { return str; } return JSON.stringify(str); }; /** * @param {Record} map value map * @returns {true|false|function(string): string} true/false, when unconditionally true/false, or a template function to determine the value at runtime */ const compileBooleanMatcher = map => { const positiveItems = Object.keys(map).filter(i => map[i]); const negativeItems = Object.keys(map).filter(i => !map[i]); if (positiveItems.length === 0) return false; if (negativeItems.length === 0) return true; return compileBooleanMatcherFromLists(positiveItems, negativeItems); }; /** * @param {string[]} positiveItems positive items * @param {string[]} negativeItems negative items * @returns {function(string): string} a template function to determine the value at runtime */ const compileBooleanMatcherFromLists = (positiveItems, negativeItems) => { if (positiveItems.length === 0) return () => "false"; if (negativeItems.length === 0) return () => "true"; if (positiveItems.length === 1) return value => `${toSimpleString(positiveItems[0])} == ${value}`; if (negativeItems.length === 1) return value => `${toSimpleString(negativeItems[0])} != ${value}`; const positiveRegexp = itemsToRegexp(positiveItems); const negativeRegexp = itemsToRegexp(negativeItems); if (positiveRegexp.length <= negativeRegexp.length) { return value => `/^${positiveRegexp}$/.test(${value})`; } else { return value => `!/^${negativeRegexp}$/.test(${value})`; } }; const popCommonItems = (itemsSet, getKey, condition) => { const map = new Map(); for (const item of itemsSet) { const key = getKey(item); if (key) { let list = map.get(key); if (list === undefined) { list = []; map.set(key, list); } list.push(item); } } const result = []; for (const list of map.values()) { if (condition(list)) { for (const item of list) { itemsSet.delete(item); } result.push(list); } } return result; }; const getCommonPrefix = items => { let prefix = items[0]; for (let i = 1; i < items.length; i++) { const item = items[i]; for (let p = 0; p < prefix.length; p++) { if (item[p] !== prefix[p]) { prefix = prefix.slice(0, p); break; } } } return prefix; }; const getCommonSuffix = items => { let suffix = items[0]; for (let i = 1; i < items.length; i++) { const item = items[i]; for (let p = item.length - 1, s = suffix.length - 1; s >= 0; p--, s--) { if (item[p] !== suffix[s]) { suffix = suffix.slice(s + 1); break; } } } return suffix; }; const itemsToRegexp = itemsArr => { if (itemsArr.length === 1) { return quoteMeta(itemsArr[0]); } const finishedItems = []; // merge single char items: (a|b|c|d|ef) => ([abcd]|ef) let countOfSingleCharItems = 0; for (const item of itemsArr) { if (item.length === 1) { countOfSingleCharItems++; } } // special case for only single char items if (countOfSingleCharItems === itemsArr.length) { return `[${quoteMeta(itemsArr.sort().join(""))}]`; } const items = new Set(itemsArr.sort()); if (countOfSingleCharItems > 2) { let singleCharItems = ""; for (const item of items) { if (item.length === 1) { singleCharItems += item; items.delete(item); } } finishedItems.push(`[${quoteMeta(singleCharItems)}]`); } // special case for 2 items with common prefix/suffix if (finishedItems.length === 0 && items.size === 2) { const prefix = getCommonPrefix(itemsArr); const suffix = getCommonSuffix( itemsArr.map(item => item.slice(prefix.length)) ); if (prefix.length > 0 || suffix.length > 0) { return `${quoteMeta(prefix)}${itemsToRegexp( itemsArr.map(i => i.slice(prefix.length, -suffix.length || undefined)) )}${quoteMeta(suffix)}`; } } // special case for 2 items with common suffix if (finishedItems.length === 0 && items.size === 2) { const it = items[Symbol.iterator](); const a = it.next().value; const b = it.next().value; if (a.length > 0 && b.length > 0 && a.slice(-1) === b.slice(-1)) { return `${itemsToRegexp([a.slice(0, -1), b.slice(0, -1)])}${quoteMeta( a.slice(-1) )}`; } } // find common prefix: (a1|a2|a3|a4|b5) => (a(1|2|3|4)|b5) const prefixed = popCommonItems( items, item => (item.length >= 1 ? item[0] : false), list => { if (list.length >= 3) return true; if (list.length <= 1) return false; return list[0][1] === list[1][1]; } ); for (const prefixedItems of prefixed) { const prefix = getCommonPrefix(prefixedItems); finishedItems.push( `${quoteMeta(prefix)}${itemsToRegexp( prefixedItems.map(i => i.slice(prefix.length)) )}` ); } // find common suffix: (a1|b1|c1|d1|e2) => ((a|b|c|d)1|e2) const suffixed = popCommonItems( items, item => (item.length >= 1 ? item.slice(-1) : false), list => { if (list.length >= 3) return true; if (list.length <= 1) return false; return list[0].slice(-2) === list[1].slice(-2); } ); for (const suffixedItems of suffixed) { const suffix = getCommonSuffix(suffixedItems); finishedItems.push( `${itemsToRegexp( suffixedItems.map(i => i.slice(0, -suffix.length)) )}${quoteMeta(suffix)}` ); } // TODO further optimize regexp, i. e. // use ranges: (1|2|3|4|a) => [1-4a] const conditional = finishedItems.concat(Array.from(items, quoteMeta)); if (conditional.length === 1) return conditional[0]; return `(${conditional.join("|")})`; }; compileBooleanMatcher.fromLists = compileBooleanMatcherFromLists; compileBooleanMatcher.itemsToRegexp = itemsToRegexp; module.exports = compileBooleanMatcher; /***/ }), /***/ 77695: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const memoize = __webpack_require__(84297); const getValidate = memoize(() => __webpack_require__(79286).validate); const createSchemaValidation = (check, getSchema, options) => { getSchema = memoize(getSchema); return value => { if (check && !check(value)) { getValidate()(getSchema(), value, options); if (check) { __webpack_require__(31669).deprecate( () => {}, "webpack bug: Pre-compiled schema reports error while real schema is happy. This has performance drawbacks.", "DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID" )(); } } }; }; module.exports = createSchemaValidation; /***/ }), /***/ 24123: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hash = __webpack_require__(21301); const BULK_SIZE = 2000; // We are using an object instead of a Map as this will stay static during the runtime // so access to it can be optimized by v8 const digestCaches = {}; class BulkUpdateDecorator extends Hash { /** * @param {Hash | function(): Hash} hashOrFactory function to create a hash * @param {string=} hashKey key for caching */ constructor(hashOrFactory, hashKey) { super(); this.hashKey = hashKey; if (typeof hashOrFactory === "function") { this.hashFactory = hashOrFactory; this.hash = undefined; } else { this.hashFactory = undefined; this.hash = hashOrFactory; } this.buffer = ""; } /** * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} * @param {string|Buffer} data data * @param {string=} inputEncoding data encoding * @returns {this} updated hash */ update(data, inputEncoding) { if ( inputEncoding !== undefined || typeof data !== "string" || data.length > BULK_SIZE ) { if (this.hash === undefined) this.hash = this.hashFactory(); if (this.buffer.length > 0) { this.hash.update(this.buffer); this.buffer = ""; } this.hash.update(data, inputEncoding); } else { this.buffer += data; if (this.buffer.length > BULK_SIZE) { if (this.hash === undefined) this.hash = this.hashFactory(); this.hash.update(this.buffer); this.buffer = ""; } } return this; } /** * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @param {string=} encoding encoding of the return value * @returns {string|Buffer} digest */ digest(encoding) { let digestCache; const buffer = this.buffer; if (this.hash === undefined) { // short data for hash, we can use caching const cacheKey = `${this.hashKey}-${encoding}`; digestCache = digestCaches[cacheKey]; if (digestCache === undefined) { digestCache = digestCaches[cacheKey] = new Map(); } const cacheEntry = digestCache.get(buffer); if (cacheEntry !== undefined) return cacheEntry; this.hash = this.hashFactory(); } if (buffer.length > 0) { this.hash.update(buffer); } const digestResult = this.hash.digest(encoding); const result = typeof digestResult === "string" ? digestResult : digestResult.toString(); if (digestCache !== undefined) { digestCache.set(buffer, result); } return result; } } /* istanbul ignore next */ class DebugHash extends Hash { constructor() { super(); this.string = ""; } /** * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} * @param {string|Buffer} data data * @param {string=} inputEncoding data encoding * @returns {this} updated hash */ update(data, inputEncoding) { if (typeof data !== "string") data = data.toString("utf-8"); if (data.startsWith("debug-digest-")) { data = Buffer.from(data.slice("debug-digest-".length), "hex").toString(); } this.string += `[${data}](${new Error().stack.split("\n", 3)[2]})\n`; return this; } /** * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @param {string=} encoding encoding of the return value * @returns {string|Buffer} digest */ digest(encoding) { return "debug-digest-" + Buffer.from(this.string).toString("hex"); } } let crypto = undefined; let createXXHash64 = undefined; let createMd4 = undefined; let BatchedHash = undefined; /** * Creates a hash by name or function * @param {string | typeof Hash} algorithm the algorithm name or a constructor creating a hash * @returns {Hash} the hash */ module.exports = algorithm => { if (typeof algorithm === "function") { return new BulkUpdateDecorator(() => new algorithm()); } switch (algorithm) { // TODO add non-cryptographic algorithm here case "debug": return new DebugHash(); case "xxhash64": if (createXXHash64 === undefined) { createXXHash64 = __webpack_require__(37364); if (BatchedHash === undefined) { BatchedHash = __webpack_require__(32928); } } return new BatchedHash(createXXHash64()); case "md4": if (createMd4 === undefined) { createMd4 = __webpack_require__(20487); if (BatchedHash === undefined) { BatchedHash = __webpack_require__(32928); } } return new BatchedHash(createMd4()); case "native-md4": if (crypto === undefined) crypto = __webpack_require__(76417); return new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4"); default: if (crypto === undefined) crypto = __webpack_require__(76417); return new BulkUpdateDecorator( () => crypto.createHash(algorithm), algorithm ); } }; /***/ }), /***/ 2594: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const util = __webpack_require__(31669); /** @type {Map} */ const deprecationCache = new Map(); /** * @typedef {Object} FakeHookMarker * @property {true} _fakeHook it's a fake hook */ /** @template T @typedef {T & FakeHookMarker} FakeHook */ /** * @param {string} message deprecation message * @param {string} code deprecation code * @returns {Function} function to trigger deprecation */ const createDeprecation = (message, code) => { const cached = deprecationCache.get(message); if (cached !== undefined) return cached; const fn = util.deprecate( () => {}, message, "DEP_WEBPACK_DEPRECATION_" + code ); deprecationCache.set(message, fn); return fn; }; const COPY_METHODS = [ "concat", "entry", "filter", "find", "findIndex", "includes", "indexOf", "join", "lastIndexOf", "map", "reduce", "reduceRight", "slice", "some" ]; const DISABLED_METHODS = [ "copyWithin", "entries", "fill", "keys", "pop", "reverse", "shift", "splice", "sort", "unshift" ]; /** * @param {any} set new set * @param {string} name property name * @returns {void} */ exports.arrayToSetDeprecation = (set, name) => { for (const method of COPY_METHODS) { if (set[method]) continue; const d = createDeprecation( `${name} was changed from Array to Set (using Array method '${method}' is deprecated)`, "ARRAY_TO_SET" ); /** * @deprecated * @this {Set} * @returns {number} count */ set[method] = function () { d(); const array = Array.from(this); return Array.prototype[method].apply(array, arguments); }; } const dPush = createDeprecation( `${name} was changed from Array to Set (using Array method 'push' is deprecated)`, "ARRAY_TO_SET_PUSH" ); const dLength = createDeprecation( `${name} was changed from Array to Set (using Array property 'length' is deprecated)`, "ARRAY_TO_SET_LENGTH" ); const dIndexer = createDeprecation( `${name} was changed from Array to Set (indexing Array is deprecated)`, "ARRAY_TO_SET_INDEXER" ); /** * @deprecated * @this {Set} * @returns {number} count */ set.push = function () { dPush(); for (const item of Array.from(arguments)) { this.add(item); } return this.size; }; for (const method of DISABLED_METHODS) { if (set[method]) continue; set[method] = () => { throw new Error( `${name} was changed from Array to Set (using Array method '${method}' is not possible)` ); }; } const createIndexGetter = index => { /** * @this {Set} a Set * @returns {any} the value at this location */ const fn = function () { dIndexer(); let i = 0; for (const item of this) { if (i++ === index) return item; } return undefined; }; return fn; }; const defineIndexGetter = index => { Object.defineProperty(set, index, { get: createIndexGetter(index), set(value) { throw new Error( `${name} was changed from Array to Set (indexing Array with write is not possible)` ); } }); }; defineIndexGetter(0); let indexerDefined = 1; Object.defineProperty(set, "length", { get() { dLength(); const length = this.size; for (indexerDefined; indexerDefined < length + 1; indexerDefined++) { defineIndexGetter(indexerDefined); } return length; }, set(value) { throw new Error( `${name} was changed from Array to Set (writing to Array property 'length' is not possible)` ); } }); set[Symbol.isConcatSpreadable] = true; }; exports.createArrayToSetDeprecationSet = name => { let initialized = false; class SetDeprecatedArray extends Set { constructor(items) { super(items); if (!initialized) { initialized = true; exports.arrayToSetDeprecation(SetDeprecatedArray.prototype, name); } } } return SetDeprecatedArray; }; exports.soonFrozenObjectDeprecation = (obj, name, code, note = "") => { const message = `${name} will be frozen in future, all modifications are deprecated.${ note && `\n${note}` }`; return new Proxy(obj, { set: util.deprecate( (target, property, value, receiver) => Reflect.set(target, property, value, receiver), message, code ), defineProperty: util.deprecate( (target, property, descriptor) => Reflect.defineProperty(target, property, descriptor), message, code ), deleteProperty: util.deprecate( (target, property) => Reflect.deleteProperty(target, property), message, code ), setPrototypeOf: util.deprecate( (target, proto) => Reflect.setPrototypeOf(target, proto), message, code ) }); }; /** * @template T * @param {T} obj object * @param {string} message deprecation message * @param {string} code deprecation code * @returns {T} object with property access deprecated */ const deprecateAllProperties = (obj, message, code) => { const newObj = {}; const descriptors = Object.getOwnPropertyDescriptors(obj); for (const name of Object.keys(descriptors)) { const descriptor = descriptors[name]; if (typeof descriptor.value === "function") { Object.defineProperty(newObj, name, { ...descriptor, value: util.deprecate(descriptor.value, message, code) }); } else if (descriptor.get || descriptor.set) { Object.defineProperty(newObj, name, { ...descriptor, get: descriptor.get && util.deprecate(descriptor.get, message, code), set: descriptor.set && util.deprecate(descriptor.set, message, code) }); } else { let value = descriptor.value; Object.defineProperty(newObj, name, { configurable: descriptor.configurable, enumerable: descriptor.enumerable, get: util.deprecate(() => value, message, code), set: descriptor.writable ? util.deprecate(v => (value = v), message, code) : undefined }); } } return /** @type {T} */ (newObj); }; exports.deprecateAllProperties = deprecateAllProperties; /** * @template T * @param {T} fakeHook fake hook implementation * @param {string=} message deprecation message (not deprecated when unset) * @param {string=} code deprecation code (not deprecated when unset) * @returns {FakeHook} fake hook which redirects */ exports.createFakeHook = (fakeHook, message, code) => { if (message && code) { fakeHook = deprecateAllProperties(fakeHook, message, code); } return Object.freeze( Object.assign(fakeHook, { _fakeHook: /** @type {true} */ (true) }) ); }; /***/ }), /***/ 37906: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // Simulations show these probabilities for a single change // 93.1% that one group is invalidated // 4.8% that two groups are invalidated // 1.1% that 3 groups are invalidated // 0.1% that 4 or more groups are invalidated // // And these for removing/adding 10 lexically adjacent files // 64.5% that one group is invalidated // 24.8% that two groups are invalidated // 7.8% that 3 groups are invalidated // 2.7% that 4 or more groups are invalidated // // And these for removing/adding 3 random files // 0% that one group is invalidated // 3.7% that two groups are invalidated // 80.8% that 3 groups are invalidated // 12.3% that 4 groups are invalidated // 3.2% that 5 or more groups are invalidated /** * * @param {string} a key * @param {string} b key * @returns {number} the similarity as number */ const similarity = (a, b) => { const l = Math.min(a.length, b.length); let dist = 0; for (let i = 0; i < l; i++) { const ca = a.charCodeAt(i); const cb = b.charCodeAt(i); dist += Math.max(0, 10 - Math.abs(ca - cb)); } return dist; }; /** * @param {string} a key * @param {string} b key * @param {Set} usedNames set of already used names * @returns {string} the common part and a single char for the difference */ const getName = (a, b, usedNames) => { const l = Math.min(a.length, b.length); let i = 0; while (i < l) { if (a.charCodeAt(i) !== b.charCodeAt(i)) { i++; break; } i++; } while (i < l) { const name = a.slice(0, i); const lowerName = name.toLowerCase(); if (!usedNames.has(lowerName)) { usedNames.add(lowerName); return name; } i++; } // names always contain a hash, so this is always unique // we don't need to check usedNames nor add it return a; }; /** * @param {Record} total total size * @param {Record} size single size * @returns {void} */ const addSizeTo = (total, size) => { for (const key of Object.keys(size)) { total[key] = (total[key] || 0) + size[key]; } }; /** * @param {Record} total total size * @param {Record} size single size * @returns {void} */ const subtractSizeFrom = (total, size) => { for (const key of Object.keys(size)) { total[key] -= size[key]; } }; /** * @param {Iterable} nodes some nodes * @returns {Record} total size */ const sumSize = nodes => { const sum = Object.create(null); for (const node of nodes) { addSizeTo(sum, node.size); } return sum; }; const isTooBig = (size, maxSize) => { for (const key of Object.keys(size)) { const s = size[key]; if (s === 0) continue; const maxSizeValue = maxSize[key]; if (typeof maxSizeValue === "number") { if (s > maxSizeValue) return true; } } return false; }; const isTooSmall = (size, minSize) => { for (const key of Object.keys(size)) { const s = size[key]; if (s === 0) continue; const minSizeValue = minSize[key]; if (typeof minSizeValue === "number") { if (s < minSizeValue) return true; } } return false; }; const getTooSmallTypes = (size, minSize) => { const types = new Set(); for (const key of Object.keys(size)) { const s = size[key]; if (s === 0) continue; const minSizeValue = minSize[key]; if (typeof minSizeValue === "number") { if (s < minSizeValue) types.add(key); } } return types; }; const getNumberOfMatchingSizeTypes = (size, types) => { let i = 0; for (const key of Object.keys(size)) { if (size[key] !== 0 && types.has(key)) i++; } return i; }; const selectiveSizeSum = (size, types) => { let sum = 0; for (const key of Object.keys(size)) { if (size[key] !== 0 && types.has(key)) sum += size[key]; } return sum; }; /** * @template T */ class Node { /** * @param {T} item item * @param {string} key key * @param {Record} size size */ constructor(item, key, size) { this.item = item; this.key = key; this.size = size; } } /** * @template T */ class Group { /** * @param {Node[]} nodes nodes * @param {number[]} similarities similarities between the nodes (length = nodes.length - 1) * @param {Record=} size size of the group */ constructor(nodes, similarities, size) { this.nodes = nodes; this.similarities = similarities; this.size = size || sumSize(nodes); /** @type {string} */ this.key = undefined; } /** * @param {function(Node): boolean} filter filter function * @returns {Node[]} removed nodes */ popNodes(filter) { const newNodes = []; const newSimilarities = []; const resultNodes = []; let lastNode; for (let i = 0; i < this.nodes.length; i++) { const node = this.nodes[i]; if (filter(node)) { resultNodes.push(node); } else { if (newNodes.length > 0) { newSimilarities.push( lastNode === this.nodes[i - 1] ? this.similarities[i - 1] : similarity(lastNode.key, node.key) ); } newNodes.push(node); lastNode = node; } } if (resultNodes.length === this.nodes.length) return undefined; this.nodes = newNodes; this.similarities = newSimilarities; this.size = sumSize(newNodes); return resultNodes; } } /** * @param {Iterable} nodes nodes * @returns {number[]} similarities */ const getSimilarities = nodes => { // calculate similarities between lexically adjacent nodes /** @type {number[]} */ const similarities = []; let last = undefined; for (const node of nodes) { if (last !== undefined) { similarities.push(similarity(last.key, node.key)); } last = node; } return similarities; }; /** * @template T * @typedef {Object} GroupedItems * @property {string} key * @property {T[]} items * @property {Record} size */ /** * @template T * @typedef {Object} Options * @property {Record} maxSize maximum size of a group * @property {Record} minSize minimum size of a group (preferred over maximum size) * @property {Iterable} items a list of items * @property {function(T): Record} getSize function to get size of an item * @property {function(T): string} getKey function to get the key of an item */ /** * @template T * @param {Options} options options object * @returns {GroupedItems[]} grouped items */ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { /** @type {Group[]} */ const result = []; const nodes = Array.from( items, item => new Node(item, getKey(item), getSize(item)) ); /** @type {Node[]} */ const initialNodes = []; // lexically ordering of keys nodes.sort((a, b) => { if (a.key < b.key) return -1; if (a.key > b.key) return 1; return 0; }); // return nodes bigger than maxSize directly as group // But make sure that minSize is not violated for (const node of nodes) { if (isTooBig(node.size, maxSize) && !isTooSmall(node.size, minSize)) { result.push(new Group([node], [])); } else { initialNodes.push(node); } } if (initialNodes.length > 0) { const initialGroup = new Group(initialNodes, getSimilarities(initialNodes)); const removeProblematicNodes = (group, consideredSize = group.size) => { const problemTypes = getTooSmallTypes(consideredSize, minSize); if (problemTypes.size > 0) { // We hit an edge case where the working set is already smaller than minSize // We merge problematic nodes with the smallest result node to keep minSize intact const problemNodes = group.popNodes( n => getNumberOfMatchingSizeTypes(n.size, problemTypes) > 0 ); if (problemNodes === undefined) return false; // Only merge it with result nodes that have the problematic size type const possibleResultGroups = result.filter( n => getNumberOfMatchingSizeTypes(n.size, problemTypes) > 0 ); if (possibleResultGroups.length > 0) { const bestGroup = possibleResultGroups.reduce((min, group) => { const minMatches = getNumberOfMatchingSizeTypes(min, problemTypes); const groupMatches = getNumberOfMatchingSizeTypes( group, problemTypes ); if (minMatches !== groupMatches) return minMatches < groupMatches ? group : min; if ( selectiveSizeSum(min.size, problemTypes) > selectiveSizeSum(group.size, problemTypes) ) return group; return min; }); for (const node of problemNodes) bestGroup.nodes.push(node); bestGroup.nodes.sort((a, b) => { if (a.key < b.key) return -1; if (a.key > b.key) return 1; return 0; }); } else { // There are no other nodes with the same size types // We create a new group and have to accept that it's smaller than minSize result.push(new Group(problemNodes, null)); } return true; } else { return false; } }; if (initialGroup.nodes.length > 0) { const queue = [initialGroup]; while (queue.length) { const group = queue.pop(); // only groups bigger than maxSize need to be splitted if (!isTooBig(group.size, maxSize)) { result.push(group); continue; } // If the group is already too small // we try to work only with the unproblematic nodes if (removeProblematicNodes(group)) { // This changed something, so we try this group again queue.push(group); continue; } // find unsplittable area from left and right // going minSize from left and right // at least one node need to be included otherwise we get stuck let left = 1; let leftSize = Object.create(null); addSizeTo(leftSize, group.nodes[0].size); while (left < group.nodes.length && isTooSmall(leftSize, minSize)) { addSizeTo(leftSize, group.nodes[left].size); left++; } let right = group.nodes.length - 2; let rightSize = Object.create(null); addSizeTo(rightSize, group.nodes[group.nodes.length - 1].size); while (right >= 0 && isTooSmall(rightSize, minSize)) { addSizeTo(rightSize, group.nodes[right].size); right--; } // left v v right // [ O O O ] O O O [ O O O ] // ^^^^^^^^^ leftSize // rightSize ^^^^^^^^^ // leftSize > minSize // rightSize > minSize // Perfect split: [ O O O ] [ O O O ] // right === left - 1 if (left - 1 > right) { // We try to remove some problematic nodes to "fix" that let prevSize; if (right < group.nodes.length - left) { subtractSizeFrom(rightSize, group.nodes[right + 1].size); prevSize = rightSize; } else { subtractSizeFrom(leftSize, group.nodes[left - 1].size); prevSize = leftSize; } if (removeProblematicNodes(group, prevSize)) { // This changed something, so we try this group again queue.push(group); continue; } // can't split group while holding minSize // because minSize is preferred of maxSize we return // the problematic nodes as result here even while it's too big // To avoid this make sure maxSize > minSize * 3 result.push(group); continue; } if (left <= right) { // when there is a area between left and right // we look for best split point // we split at the minimum similarity // here key space is separated the most // But we also need to make sure to not create too small groups let best = -1; let bestSimilarity = Infinity; let pos = left; let rightSize = sumSize(group.nodes.slice(pos)); // pos v v right // [ O O O ] O O O [ O O O ] // ^^^^^^^^^ leftSize // rightSize ^^^^^^^^^^^^^^^ while (pos <= right + 1) { const similarity = group.similarities[pos - 1]; if ( similarity < bestSimilarity && !isTooSmall(leftSize, minSize) && !isTooSmall(rightSize, minSize) ) { best = pos; bestSimilarity = similarity; } addSizeTo(leftSize, group.nodes[pos].size); subtractSizeFrom(rightSize, group.nodes[pos].size); pos++; } if (best < 0) { // This can't happen // but if that assumption is wrong // fallback to a big group result.push(group); continue; } left = best; right = best - 1; } // create two new groups for left and right area // and queue them up const rightNodes = [group.nodes[right + 1]]; /** @type {number[]} */ const rightSimilarities = []; for (let i = right + 2; i < group.nodes.length; i++) { rightSimilarities.push(group.similarities[i - 1]); rightNodes.push(group.nodes[i]); } queue.push(new Group(rightNodes, rightSimilarities)); const leftNodes = [group.nodes[0]]; /** @type {number[]} */ const leftSimilarities = []; for (let i = 1; i < left; i++) { leftSimilarities.push(group.similarities[i - 1]); leftNodes.push(group.nodes[i]); } queue.push(new Group(leftNodes, leftSimilarities)); } } } // lexically ordering result.sort((a, b) => { if (a.nodes[0].key < b.nodes[0].key) return -1; if (a.nodes[0].key > b.nodes[0].key) return 1; return 0; }); // give every group a name const usedNames = new Set(); for (let i = 0; i < result.length; i++) { const group = result[i]; if (group.nodes.length === 1) { group.key = group.nodes[0].key; } else { const first = group.nodes[0]; const last = group.nodes[group.nodes.length - 1]; const name = getName(first.key, last.key, usedNames); group.key = name; } } // return the results return result.map(group => { /** @type {GroupedItems} */ return { key: group.key, items: group.nodes.map(node => node.item), size: group.size }; }); }; /***/ }), /***/ 31670: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Sam Chen @chenxsan */ /** * @param {string} urlAndGlobal the script request * @returns {string[]} script url and its global variable */ module.exports = function extractUrlAndGlobal(urlAndGlobal) { const index = urlAndGlobal.indexOf("@"); return [urlAndGlobal.substring(index + 1), urlAndGlobal.substring(0, index)]; }; /***/ }), /***/ 38670: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const NO_MARKER = 0; const IN_PROGRESS_MARKER = 1; const DONE_MARKER = 2; const DONE_MAYBE_ROOT_CYCLE_MARKER = 3; const DONE_AND_ROOT_MARKER = 4; /** * @template T */ class Node { /** * @param {T} item the value of the node */ constructor(item) { this.item = item; /** @type {Set>} */ this.dependencies = new Set(); this.marker = NO_MARKER; /** @type {Cycle | undefined} */ this.cycle = undefined; this.incoming = 0; } } /** * @template T */ class Cycle { constructor() { /** @type {Set>} */ this.nodes = new Set(); } } /** * @template T * @typedef {Object} StackEntry * @property {Node} node * @property {Node[]} openEdges */ /** * @template T * @param {Iterable} items list of items * @param {function(T): Iterable} getDependencies function to get dependencies of an item (items that are not in list are ignored) * @returns {Iterable} graph roots of the items */ module.exports = (items, getDependencies) => { /** @type {Map>} */ const itemToNode = new Map(); for (const item of items) { const node = new Node(item); itemToNode.set(item, node); } // early exit when there is only a single item if (itemToNode.size <= 1) return items; // grab all the dependencies for (const node of itemToNode.values()) { for (const dep of getDependencies(node.item)) { const depNode = itemToNode.get(dep); if (depNode !== undefined) { node.dependencies.add(depNode); } } } // Set of current root modules // items will be removed if a new reference to it has been found /** @type {Set>} */ const roots = new Set(); // Set of current cycles without references to it // cycles will be removed if a new reference to it has been found // that is not part of the cycle /** @type {Set>} */ const rootCycles = new Set(); // For all non-marked nodes for (const selectedNode of itemToNode.values()) { if (selectedNode.marker === NO_MARKER) { // deep-walk all referenced modules // in a non-recursive way // start by entering the selected node selectedNode.marker = IN_PROGRESS_MARKER; // keep a stack to avoid recursive walk /** @type {StackEntry[]} */ const stack = [ { node: selectedNode, openEdges: Array.from(selectedNode.dependencies) } ]; // process the top item until stack is empty while (stack.length > 0) { const topOfStack = stack[stack.length - 1]; // Are there still edges unprocessed in the current node? if (topOfStack.openEdges.length > 0) { // Process one dependency const dependency = topOfStack.openEdges.pop(); switch (dependency.marker) { case NO_MARKER: // dependency has not be visited yet // mark it as in-progress and recurse stack.push({ node: dependency, openEdges: Array.from(dependency.dependencies) }); dependency.marker = IN_PROGRESS_MARKER; break; case IN_PROGRESS_MARKER: { // It's a in-progress cycle let cycle = dependency.cycle; if (!cycle) { cycle = new Cycle(); cycle.nodes.add(dependency); dependency.cycle = cycle; } // set cycle property for each node in the cycle // if nodes are already part of a cycle // we merge the cycles to a shared cycle for ( let i = stack.length - 1; stack[i].node !== dependency; i-- ) { const node = stack[i].node; if (node.cycle) { if (node.cycle !== cycle) { // merge cycles for (const cycleNode of node.cycle.nodes) { cycleNode.cycle = cycle; cycle.nodes.add(cycleNode); } } } else { node.cycle = cycle; cycle.nodes.add(node); } } // don't recurse into dependencies // these are already on the stack break; } case DONE_AND_ROOT_MARKER: // This node has be visited yet and is currently a root node // But as this is a new reference to the node // it's not really a root // so we have to convert it to a normal node dependency.marker = DONE_MARKER; roots.delete(dependency); break; case DONE_MAYBE_ROOT_CYCLE_MARKER: // This node has be visited yet and // is maybe currently part of a completed root cycle // we found a new reference to the cycle // so it's not really a root cycle // remove the cycle from the root cycles // and convert it to a normal node rootCycles.delete(dependency.cycle); dependency.marker = DONE_MARKER; break; // DONE_MARKER: nothing to do, don't recurse into dependencies } } else { // All dependencies of the current node has been visited // we leave the node stack.pop(); topOfStack.node.marker = DONE_MARKER; } } const cycle = selectedNode.cycle; if (cycle) { for (const node of cycle.nodes) { node.marker = DONE_MAYBE_ROOT_CYCLE_MARKER; } rootCycles.add(cycle); } else { selectedNode.marker = DONE_AND_ROOT_MARKER; roots.add(selectedNode); } } } // Extract roots from root cycles // We take the nodes with most incoming edges // inside of the cycle for (const cycle of rootCycles) { let max = 0; /** @type {Set>} */ const cycleRoots = new Set(); const nodes = cycle.nodes; for (const node of nodes) { for (const dep of node.dependencies) { if (nodes.has(dep)) { dep.incoming++; if (dep.incoming < max) continue; if (dep.incoming > max) { cycleRoots.clear(); max = dep.incoming; } cycleRoots.add(dep); } } } for (const cycleRoot of cycleRoots) { roots.add(cycleRoot); } } // When roots were found, return them if (roots.size > 0) { return Array.from(roots, r => r.item); } else { throw new Error("Implementation of findGraphRoots is broken"); } }; /***/ }), /***/ 93204: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const path = __webpack_require__(85622); /** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */ /** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */ /** * @typedef {Object} IStats * @property {() => boolean} isFile * @property {() => boolean} isDirectory * @property {() => boolean} isBlockDevice * @property {() => boolean} isCharacterDevice * @property {() => boolean} isSymbolicLink * @property {() => boolean} isFIFO * @property {() => boolean} isSocket * @property {number | bigint} dev * @property {number | bigint} ino * @property {number | bigint} mode * @property {number | bigint} nlink * @property {number | bigint} uid * @property {number | bigint} gid * @property {number | bigint} rdev * @property {number | bigint} size * @property {number | bigint} blksize * @property {number | bigint} blocks * @property {number | bigint} atimeMs * @property {number | bigint} mtimeMs * @property {number | bigint} ctimeMs * @property {number | bigint} birthtimeMs * @property {Date} atime * @property {Date} mtime * @property {Date} ctime * @property {Date} birthtime */ /** * @typedef {Object} IDirent * @property {() => boolean} isFile * @property {() => boolean} isDirectory * @property {() => boolean} isBlockDevice * @property {() => boolean} isCharacterDevice * @property {() => boolean} isSymbolicLink * @property {() => boolean} isFIFO * @property {() => boolean} isSocket * @property {string | Buffer} name */ /** @typedef {function((NodeJS.ErrnoException | null)=): void} Callback */ /** @typedef {function((NodeJS.ErrnoException | null)=, Buffer=): void} BufferCallback */ /** @typedef {function((NodeJS.ErrnoException | null)=, Buffer|string=): void} BufferOrStringCallback */ /** @typedef {function((NodeJS.ErrnoException | null)=, (string | Buffer)[] | IDirent[]=): void} DirentArrayCallback */ /** @typedef {function((NodeJS.ErrnoException | null)=, string=): void} StringCallback */ /** @typedef {function((NodeJS.ErrnoException | null)=, number=): void} NumberCallback */ /** @typedef {function((NodeJS.ErrnoException | null)=, IStats=): void} StatsCallback */ /** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */ /** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */ /** * @typedef {Object} WatcherInfo * @property {Set} changes get current aggregated changes that have not yet send to callback * @property {Set} removals get current aggregated removals that have not yet send to callback * @property {Map} fileTimeInfoEntries get info about files * @property {Map} contextTimeInfoEntries get info about directories */ // TODO webpack 6 deprecate missing getInfo /** * @typedef {Object} Watcher * @property {function(): void} close closes the watcher and all underlying file watchers * @property {function(): void} pause closes the watcher, but keeps underlying file watchers alive until the next watch call * @property {function(): Set=} getAggregatedChanges get current aggregated changes that have not yet send to callback * @property {function(): Set=} getAggregatedRemovals get current aggregated removals that have not yet send to callback * @property {function(): Map} getFileTimeInfoEntries get info about files * @property {function(): Map} getContextTimeInfoEntries get info about directories * @property {function(): WatcherInfo=} getInfo get info about timestamps and changes */ /** * @callback WatchMethod * @param {Iterable} files watched files * @param {Iterable} directories watched directories * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object * @param {function(Error=, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ // TODO webpack 6 make optional methods required /** * @typedef {Object} OutputFileSystem * @property {function(string, Buffer|string, Callback): void} writeFile * @property {function(string, Callback): void} mkdir * @property {function(string, DirentArrayCallback): void=} readdir * @property {function(string, Callback): void=} rmdir * @property {function(string, Callback): void=} unlink * @property {function(string, StatsCallback): void} stat * @property {function(string, StatsCallback): void=} lstat * @property {function(string, BufferOrStringCallback): void} readFile * @property {(function(string, string): string)=} join * @property {(function(string, string): string)=} relative * @property {(function(string): string)=} dirname */ /** * @typedef {Object} InputFileSystem * @property {function(string, BufferOrStringCallback): void} readFile * @property {(function(string, ReadJsonCallback): void)=} readJson * @property {function(string, BufferOrStringCallback): void} readlink * @property {function(string, DirentArrayCallback): void} readdir * @property {function(string, StatsCallback): void} stat * @property {function(string, StatsCallback): void=} lstat * @property {(function(string, BufferOrStringCallback): void)=} realpath * @property {(function(string=): void)=} purge * @property {(function(string, string): string)=} join * @property {(function(string, string): string)=} relative * @property {(function(string): string)=} dirname */ /** * @typedef {Object} WatchFileSystem * @property {WatchMethod} watch */ /** * @typedef {Object} IntermediateFileSystemExtras * @property {function(string): void} mkdirSync * @property {function(string): NodeJS.WritableStream} createWriteStream * @property {function(string, string, NumberCallback): void} open * @property {function(number, Buffer, number, number, number, NumberCallback): void} read * @property {function(number, Callback): void} close * @property {function(string, string, Callback): void} rename */ /** @typedef {InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras} IntermediateFileSystem */ /** * * @param {InputFileSystem|OutputFileSystem|undefined} fs a file system * @param {string} rootPath the root path * @param {string} targetPath the target path * @returns {string} location of targetPath relative to rootPath */ const relative = (fs, rootPath, targetPath) => { if (fs && fs.relative) { return fs.relative(rootPath, targetPath); } else if (path.posix.isAbsolute(rootPath)) { return path.posix.relative(rootPath, targetPath); } else if (path.win32.isAbsolute(rootPath)) { return path.win32.relative(rootPath, targetPath); } else { throw new Error( `${rootPath} is neither a posix nor a windows path, and there is no 'relative' method defined in the file system` ); } }; exports.relative = relative; /** * @param {InputFileSystem|OutputFileSystem|undefined} fs a file system * @param {string} rootPath a path * @param {string} filename a filename * @returns {string} the joined path */ const join = (fs, rootPath, filename) => { if (fs && fs.join) { return fs.join(rootPath, filename); } else if (path.posix.isAbsolute(rootPath)) { return path.posix.join(rootPath, filename); } else if (path.win32.isAbsolute(rootPath)) { return path.win32.join(rootPath, filename); } else { throw new Error( `${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system` ); } }; exports.join = join; /** * @param {InputFileSystem|OutputFileSystem|undefined} fs a file system * @param {string} absPath an absolute path * @returns {string} the parent directory of the absolute path */ const dirname = (fs, absPath) => { if (fs && fs.dirname) { return fs.dirname(absPath); } else if (path.posix.isAbsolute(absPath)) { return path.posix.dirname(absPath); } else if (path.win32.isAbsolute(absPath)) { return path.win32.dirname(absPath); } else { throw new Error( `${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system` ); } }; exports.dirname = dirname; /** * @param {OutputFileSystem} fs a file system * @param {string} p an absolute path * @param {function(Error=): void} callback callback function for the error * @returns {void} */ const mkdirp = (fs, p, callback) => { fs.mkdir(p, err => { if (err) { if (err.code === "ENOENT") { const dir = dirname(fs, p); if (dir === p) { callback(err); return; } mkdirp(fs, dir, err => { if (err) { callback(err); return; } fs.mkdir(p, err => { if (err) { if (err.code === "EEXIST") { callback(); return; } callback(err); return; } callback(); }); }); return; } else if (err.code === "EEXIST") { callback(); return; } callback(err); return; } callback(); }); }; exports.mkdirp = mkdirp; /** * @param {IntermediateFileSystem} fs a file system * @param {string} p an absolute path * @returns {void} */ const mkdirpSync = (fs, p) => { try { fs.mkdirSync(p); } catch (err) { if (err) { if (err.code === "ENOENT") { const dir = dirname(fs, p); if (dir === p) { throw err; } mkdirpSync(fs, dir); fs.mkdirSync(p); return; } else if (err.code === "EEXIST") { return; } throw err; } } }; exports.mkdirpSync = mkdirpSync; /** * @param {InputFileSystem} fs a file system * @param {string} p an absolute path * @param {ReadJsonCallback} callback callback * @returns {void} */ const readJson = (fs, p, callback) => { if ("readJson" in fs) return fs.readJson(p, callback); fs.readFile(p, (err, buf) => { if (err) return callback(err); let data; try { data = JSON.parse(buf.toString("utf-8")); } catch (e) { return callback(e); } return callback(null, data); }); }; exports.readJson = readJson; /** * @param {InputFileSystem} fs a file system * @param {string} p an absolute path * @param {ReadJsonCallback} callback callback * @returns {void} */ const lstatReadlinkAbsolute = (fs, p, callback) => { let i = 3; const doReadLink = () => { fs.readlink(p, (err, target) => { if (err && --i > 0) { // It might was just changed from symlink to file // we retry 2 times to catch this case before throwing the error return doStat(); } if (err || !target) return doStat(); const value = target.toString(); callback(null, join(fs, dirname(fs, p), value)); }); }; const doStat = () => { if ("lstat" in fs) { return fs.lstat(p, (err, stats) => { if (err) return callback(err); if (stats.isSymbolicLink()) { return doReadLink(); } callback(null, stats); }); } else { return fs.stat(p, callback); } }; if ("lstat" in fs) return doStat(); doReadLink(); }; exports.lstatReadlinkAbsolute = lstatReadlinkAbsolute; /***/ }), /***/ 32928: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hash = __webpack_require__(21301); const MAX_SHORT_STRING = __webpack_require__(21941).MAX_SHORT_STRING; class BatchedHash extends Hash { constructor(hash) { super(); this.string = undefined; this.encoding = undefined; this.hash = hash; } /** * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} * @param {string|Buffer} data data * @param {string=} inputEncoding data encoding * @returns {this} updated hash */ update(data, inputEncoding) { if (this.string !== undefined) { if ( typeof data === "string" && inputEncoding === this.encoding && this.string.length + data.length < MAX_SHORT_STRING ) { this.string += data; return this; } this.hash.update(this.string, this.encoding); this.string = undefined; } if (typeof data === "string") { if ( data.length < MAX_SHORT_STRING && // base64 encoding is not valid since it may contain padding chars (!inputEncoding || !inputEncoding.startsWith("ba")) ) { this.string = data; this.encoding = inputEncoding; } else { this.hash.update(data, inputEncoding); } } else { this.hash.update(data); } return this; } /** * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @param {string=} encoding encoding of the return value * @returns {string|Buffer} digest */ digest(encoding) { if (this.string !== undefined) { this.hash.update(this.string, this.encoding); } return this.hash.digest(encoding); } } module.exports = BatchedHash; /***/ }), /***/ 20487: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const create = __webpack_require__(21941); //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1 const md4 = new WebAssembly.Module( Buffer.from( // 2156 bytes "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64" ) ); //#endregion module.exports = create.bind(null, md4, [], 64, 32); /***/ }), /***/ 21941: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // 65536 is the size of a wasm memory page // 64 is the maximum chunk size for every possible wasm hash implementation // 4 is the maximum number of bytes per char for string encoding (max is utf-8) // ~3 makes sure that it's always a block of 4 chars, so avoid partially encoded bytes for base64 const MAX_SHORT_STRING = Math.floor((65536 - 64) / 4) & ~3; class WasmHash { /** * @param {WebAssembly.Instance} instance wasm instance * @param {WebAssembly.Instance[]} instancesPool pool of instances * @param {number} chunkSize size of data chunks passed to wasm * @param {number} digestSize size of digest returned by wasm */ constructor(instance, instancesPool, chunkSize, digestSize) { const exports = /** @type {any} */ (instance.exports); exports.init(); this.exports = exports; this.mem = Buffer.from(exports.memory.buffer, 0, 65536); this.buffered = 0; this.instancesPool = instancesPool; this.chunkSize = chunkSize; this.digestSize = digestSize; } reset() { this.buffered = 0; this.exports.init(); } /** * @param {Buffer | string} data data * @param {BufferEncoding=} encoding encoding * @returns {this} itself */ update(data, encoding) { if (typeof data === "string") { while (data.length > MAX_SHORT_STRING) { this._updateWithShortString(data.slice(0, MAX_SHORT_STRING), encoding); data = data.slice(MAX_SHORT_STRING); } this._updateWithShortString(data, encoding); return this; } this._updateWithBuffer(data); return this; } /** * @param {string} data data * @param {BufferEncoding=} encoding encoding * @returns {void} */ _updateWithShortString(data, encoding) { const { exports, buffered, mem, chunkSize } = this; let endPos; if (data.length < 70) { if (!encoding || encoding === "utf-8" || encoding === "utf8") { endPos = buffered; for (let i = 0; i < data.length; i++) { const cc = data.charCodeAt(i); if (cc < 0x80) mem[endPos++] = cc; else if (cc < 0x800) { mem[endPos] = (cc >> 6) | 0xc0; mem[endPos + 1] = (cc & 0x3f) | 0x80; endPos += 2; } else { // bail-out for weird chars endPos += mem.write(data.slice(i), endPos, encoding); break; } } } else if (encoding === "latin1") { endPos = buffered; for (let i = 0; i < data.length; i++) { const cc = data.charCodeAt(i); mem[endPos++] = cc; } } else { endPos = buffered + mem.write(data, buffered, encoding); } } else { endPos = buffered + mem.write(data, buffered, encoding); } if (endPos < chunkSize) { this.buffered = endPos; } else { const l = endPos & ~(this.chunkSize - 1); exports.update(l); const newBuffered = endPos - l; this.buffered = newBuffered; if (newBuffered > 0) mem.copyWithin(0, l, endPos); } } /** * @param {Buffer} data data * @returns {void} */ _updateWithBuffer(data) { const { exports, buffered, mem } = this; const length = data.length; if (buffered + length < this.chunkSize) { data.copy(mem, buffered, 0, length); this.buffered += length; } else { const l = (buffered + length) & ~(this.chunkSize - 1); if (l > 65536) { let i = 65536 - buffered; data.copy(mem, buffered, 0, i); exports.update(65536); const stop = l - buffered - 65536; while (i < stop) { data.copy(mem, 0, i, i + 65536); exports.update(65536); i += 65536; } data.copy(mem, 0, i, l - buffered); exports.update(l - buffered - i); } else { data.copy(mem, buffered, 0, l - buffered); exports.update(l); } const newBuffered = length + buffered - l; this.buffered = newBuffered; if (newBuffered > 0) data.copy(mem, 0, length - newBuffered, length); } } digest(type) { const { exports, buffered, mem, digestSize } = this; exports.final(buffered); this.instancesPool.push(this); const hex = mem.toString("latin1", 0, digestSize); if (type === "hex") return hex; if (type === "binary" || !type) return Buffer.from(hex, "hex"); return Buffer.from(hex, "hex").toString(type); } } const create = (wasmModule, instancesPool, chunkSize, digestSize) => { if (instancesPool.length > 0) { const old = instancesPool.pop(); old.reset(); return old; } else { return new WasmHash( new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize ); } }; module.exports = create; module.exports.MAX_SHORT_STRING = MAX_SHORT_STRING; /***/ }), /***/ 37364: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const create = __webpack_require__(21941); //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1 const xxhash64 = new WebAssembly.Module( Buffer.from( // 1173 bytes "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64" ) ); //#endregion module.exports = create.bind(null, xxhash64, [], 32, 16); /***/ }), /***/ 96236: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const path = __webpack_require__(85622); const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/; const SEGMENTS_SPLIT_REGEXP = /([|!])/; const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g; /** * @typedef {Object} MakeRelativePathsCache * @property {Map>=} relativePaths */ const relativePathToRequest = relativePath => { if (relativePath === "") return "./."; if (relativePath === "..") return "../."; if (relativePath.startsWith("../")) return relativePath; return `./${relativePath}`; }; /** * @param {string} context context for relative path * @param {string} maybeAbsolutePath path to make relative * @returns {string} relative path in request style */ const absoluteToRequest = (context, maybeAbsolutePath) => { if (maybeAbsolutePath[0] === "/") { if ( maybeAbsolutePath.length > 1 && maybeAbsolutePath[maybeAbsolutePath.length - 1] === "/" ) { // this 'path' is actually a regexp generated by dynamic requires. // Don't treat it as an absolute path. return maybeAbsolutePath; } const querySplitPos = maybeAbsolutePath.indexOf("?"); let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos); resource = relativePathToRequest(path.posix.relative(context, resource)); return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos); } if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) { const querySplitPos = maybeAbsolutePath.indexOf("?"); let resource = querySplitPos === -1 ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos); resource = path.win32.relative(context, resource); if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) { resource = relativePathToRequest( resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/") ); } return querySplitPos === -1 ? resource : resource + maybeAbsolutePath.slice(querySplitPos); } // not an absolute path return maybeAbsolutePath; }; /** * @param {string} context context for relative path * @param {string} relativePath path * @returns {string} absolute path */ const requestToAbsolute = (context, relativePath) => { if (relativePath.startsWith("./") || relativePath.startsWith("../")) return path.join(context, relativePath); return relativePath; }; const makeCacheable = fn => { /** @type {WeakMap>>} */ const cache = new WeakMap(); /** * @param {string} context context used to create relative path * @param {string} identifier identifier used to create relative path * @param {Object=} associatedObjectForCache an object to which the cache will be attached * @returns {string} the returned relative path */ const cachedFn = (context, identifier, associatedObjectForCache) => { if (!associatedObjectForCache) return fn(context, identifier); let innerCache = cache.get(associatedObjectForCache); if (innerCache === undefined) { innerCache = new Map(); cache.set(associatedObjectForCache, innerCache); } let cachedResult; let innerSubCache = innerCache.get(context); if (innerSubCache === undefined) { innerCache.set(context, (innerSubCache = new Map())); } else { cachedResult = innerSubCache.get(identifier); } if (cachedResult !== undefined) { return cachedResult; } else { const result = fn(context, identifier); innerSubCache.set(identifier, result); return result; } }; /** * @param {Object=} associatedObjectForCache an object to which the cache will be attached * @returns {function(string, string): string} cached function */ cachedFn.bindCache = associatedObjectForCache => { let innerCache; if (associatedObjectForCache) { innerCache = cache.get(associatedObjectForCache); if (innerCache === undefined) { innerCache = new Map(); cache.set(associatedObjectForCache, innerCache); } } else { innerCache = new Map(); } /** * @param {string} context context used to create relative path * @param {string} identifier identifier used to create relative path * @returns {string} the returned relative path */ const boundFn = (context, identifier) => { let cachedResult; let innerSubCache = innerCache.get(context); if (innerSubCache === undefined) { innerCache.set(context, (innerSubCache = new Map())); } else { cachedResult = innerSubCache.get(identifier); } if (cachedResult !== undefined) { return cachedResult; } else { const result = fn(context, identifier); innerSubCache.set(identifier, result); return result; } }; return boundFn; }; /** * @param {string} context context used to create relative path * @param {Object=} associatedObjectForCache an object to which the cache will be attached * @returns {function(string): string} cached function */ cachedFn.bindContextCache = (context, associatedObjectForCache) => { let innerSubCache; if (associatedObjectForCache) { let innerCache = cache.get(associatedObjectForCache); if (innerCache === undefined) { innerCache = new Map(); cache.set(associatedObjectForCache, innerCache); } innerSubCache = innerCache.get(context); if (innerSubCache === undefined) { innerCache.set(context, (innerSubCache = new Map())); } } else { innerSubCache = new Map(); } /** * @param {string} identifier identifier used to create relative path * @returns {string} the returned relative path */ const boundFn = identifier => { const cachedResult = innerSubCache.get(identifier); if (cachedResult !== undefined) { return cachedResult; } else { const result = fn(context, identifier); innerSubCache.set(identifier, result); return result; } }; return boundFn; }; return cachedFn; }; /** * * @param {string} context context for relative path * @param {string} identifier identifier for path * @returns {string} a converted relative path */ const _makePathsRelative = (context, identifier) => { return identifier .split(SEGMENTS_SPLIT_REGEXP) .map(str => absoluteToRequest(context, str)) .join(""); }; exports.makePathsRelative = makeCacheable(_makePathsRelative); /** * * @param {string} context context for relative path * @param {string} identifier identifier for path * @returns {string} a converted relative path */ const _makePathsAbsolute = (context, identifier) => { return identifier .split(SEGMENTS_SPLIT_REGEXP) .map(str => requestToAbsolute(context, str)) .join(""); }; exports.makePathsAbsolute = makeCacheable(_makePathsAbsolute); /** * @param {string} context absolute context path * @param {string} request any request string may containing absolute paths, query string, etc. * @returns {string} a new request string avoiding absolute paths when possible */ const _contextify = (context, request) => { return request .split("!") .map(r => absoluteToRequest(context, r)) .join("!"); }; const contextify = makeCacheable(_contextify); exports.contextify = contextify; /** * @param {string} context absolute context path * @param {string} request any request string * @returns {string} a new request string using absolute paths when possible */ const _absolutify = (context, request) => { return request .split("!") .map(r => requestToAbsolute(context, r)) .join("!"); }; const absolutify = makeCacheable(_absolutify); exports.absolutify = absolutify; const PATH_QUERY_FRAGMENT_REGEXP = /^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; /** @typedef {{ resource: string, path: string, query: string, fragment: string }} ParsedResource */ /** * @param {string} str the path with query and fragment * @returns {ParsedResource} parsed parts */ const _parseResource = str => { const match = PATH_QUERY_FRAGMENT_REGEXP.exec(str); return { resource: str, path: match[1].replace(/\0(.)/g, "$1"), query: match[2] ? match[2].replace(/\0(.)/g, "$1") : "", fragment: match[3] || "" }; }; exports.parseResource = (realFn => { /** @type {WeakMap>} */ const cache = new WeakMap(); const getCache = associatedObjectForCache => { const entry = cache.get(associatedObjectForCache); if (entry !== undefined) return entry; /** @type {Map} */ const map = new Map(); cache.set(associatedObjectForCache, map); return map; }; /** * @param {string} str the path with query and fragment * @param {Object=} associatedObjectForCache an object to which the cache will be attached * @returns {ParsedResource} parsed parts */ const fn = (str, associatedObjectForCache) => { if (!associatedObjectForCache) return realFn(str); const cache = getCache(associatedObjectForCache); const entry = cache.get(str); if (entry !== undefined) return entry; const result = realFn(str); cache.set(str, result); return result; }; fn.bindCache = associatedObjectForCache => { const cache = getCache(associatedObjectForCache); return str => { const entry = cache.get(str); if (entry !== undefined) return entry; const result = realFn(str); cache.set(str, result); return result; }; }; return fn; })(_parseResource); /** * @param {string} filename the filename which should be undone * @param {string} outputPath the output path that is restored (only relevant when filename contains "..") * @param {boolean} enforceRelative true returns ./ for empty paths * @returns {string} repeated ../ to leave the directory of the provided filename to be back on output dir */ exports.getUndoPath = (filename, outputPath, enforceRelative) => { let depth = -1; let append = ""; outputPath = outputPath.replace(/[\\/]$/, ""); for (const part of filename.split(/[/\\]+/)) { if (part === "..") { if (depth > -1) { depth--; } else { const i = outputPath.lastIndexOf("/"); const j = outputPath.lastIndexOf("\\"); const pos = i < 0 ? j : j < 0 ? i : Math.max(i, j); if (pos < 0) return outputPath + "/"; append = outputPath.slice(pos + 1) + "/" + append; outputPath = outputPath.slice(0, pos); } } else if (part !== ".") { depth++; } } return depth > 0 ? `${"../".repeat(depth)}${append}` : enforceRelative ? `./${append}` : append; }; /***/ }), /***/ 7679: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // We need to include a list of requires here // to allow webpack to be bundled with only static requires // We could use a dynamic require(`../${request}`) but this // would include too many modules and not every tool is able // to process this module.exports = { AsyncDependenciesBlock: () => __webpack_require__(11315), CommentCompilationWarning: () => __webpack_require__(28151), ContextModule: () => __webpack_require__(80207), "cache/PackFileCacheStrategy": () => __webpack_require__(46810), "cache/ResolverCachePlugin": () => __webpack_require__(11740), "container/ContainerEntryDependency": () => __webpack_require__(44055), "container/ContainerEntryModule": () => __webpack_require__(3234), "container/ContainerExposedDependency": () => __webpack_require__(50), "container/FallbackDependency": () => __webpack_require__(41061), "container/FallbackItemDependency": () => __webpack_require__(33393), "container/FallbackModule": () => __webpack_require__(95193), "container/RemoteModule": () => __webpack_require__(581), "container/RemoteToExternalDependency": () => __webpack_require__(44637), "dependencies/AMDDefineDependency": () => __webpack_require__(76309), "dependencies/AMDRequireArrayDependency": () => __webpack_require__(98233), "dependencies/AMDRequireContextDependency": () => __webpack_require__(60958), "dependencies/AMDRequireDependenciesBlock": () => __webpack_require__(69675), "dependencies/AMDRequireDependency": () => __webpack_require__(11311), "dependencies/AMDRequireItemDependency": () => __webpack_require__(90377), "dependencies/CachedConstDependency": () => __webpack_require__(64177), "dependencies/CreateScriptUrlDependency": () => __webpack_require__(29829), "dependencies/CommonJsRequireContextDependency": () => __webpack_require__(84175), "dependencies/CommonJsExportRequireDependency": () => __webpack_require__(76922), "dependencies/CommonJsExportsDependency": () => __webpack_require__(9585), "dependencies/CommonJsFullRequireDependency": () => __webpack_require__(29496), "dependencies/CommonJsRequireDependency": () => __webpack_require__(38604), "dependencies/CommonJsSelfReferenceDependency": () => __webpack_require__(69217), "dependencies/ConstDependency": () => __webpack_require__(60864), "dependencies/ContextDependency": () => __webpack_require__(67840), "dependencies/ContextElementDependency": () => __webpack_require__(83853), "dependencies/CriticalDependencyWarning": () => __webpack_require__(14190), "dependencies/DelegatedSourceDependency": () => __webpack_require__(82766), "dependencies/DllEntryDependency": () => __webpack_require__(57839), "dependencies/EntryDependency": () => __webpack_require__(41075), "dependencies/ExportsInfoDependency": () => __webpack_require__(30474), "dependencies/HarmonyAcceptDependency": () => __webpack_require__(38421), "dependencies/HarmonyAcceptImportDependency": () => __webpack_require__(35316), "dependencies/HarmonyCompatibilityDependency": () => __webpack_require__(56164), "dependencies/HarmonyExportExpressionDependency": () => __webpack_require__(22705), "dependencies/HarmonyExportHeaderDependency": () => __webpack_require__(67159), "dependencies/HarmonyExportImportedSpecifierDependency": () => __webpack_require__(77952), "dependencies/HarmonyExportSpecifierDependency": () => __webpack_require__(59042), "dependencies/HarmonyImportSideEffectDependency": () => __webpack_require__(76853), "dependencies/HarmonyImportSpecifierDependency": () => __webpack_require__(61994), "dependencies/ImportContextDependency": () => __webpack_require__(75785), "dependencies/ImportDependency": () => __webpack_require__(16727), "dependencies/ImportEagerDependency": () => __webpack_require__(91941), "dependencies/ImportWeakDependency": () => __webpack_require__(58426), "dependencies/JsonExportsDependency": () => __webpack_require__(36986), "dependencies/LocalModule": () => __webpack_require__(930), "dependencies/LocalModuleDependency": () => __webpack_require__(67494), "dependencies/ModuleDecoratorDependency": () => __webpack_require__(58969), "dependencies/ModuleHotAcceptDependency": () => __webpack_require__(90200), "dependencies/ModuleHotDeclineDependency": () => __webpack_require__(72986), "dependencies/ImportMetaHotAcceptDependency": () => __webpack_require__(58287), "dependencies/ImportMetaHotDeclineDependency": () => __webpack_require__(89911), "dependencies/ProvidedDependency": () => __webpack_require__(88915), "dependencies/PureExpressionDependency": () => __webpack_require__(24746), "dependencies/RequireContextDependency": () => __webpack_require__(98854), "dependencies/RequireEnsureDependenciesBlock": () => __webpack_require__(91421), "dependencies/RequireEnsureDependency": () => __webpack_require__(975), "dependencies/RequireEnsureItemDependency": () => __webpack_require__(56867), "dependencies/RequireHeaderDependency": () => __webpack_require__(57010), "dependencies/RequireIncludeDependency": () => __webpack_require__(17046), "dependencies/RequireIncludeDependencyParserPlugin": () => __webpack_require__(29984), "dependencies/RequireResolveContextDependency": () => __webpack_require__(48789), "dependencies/RequireResolveDependency": () => __webpack_require__(93172), "dependencies/RequireResolveHeaderDependency": () => __webpack_require__(24128), "dependencies/RuntimeRequirementsDependency": () => __webpack_require__(75941), "dependencies/StaticExportsDependency": () => __webpack_require__(67967), "dependencies/SystemPlugin": () => __webpack_require__(88768), "dependencies/UnsupportedDependency": () => __webpack_require__(41381), "dependencies/URLDependency": () => __webpack_require__(30990), "dependencies/WebAssemblyExportImportedDependency": () => __webpack_require__(18248), "dependencies/WebAssemblyImportDependency": () => __webpack_require__(97093), "dependencies/WebpackIsIncludedDependency": () => __webpack_require__(41744), "dependencies/WorkerDependency": () => __webpack_require__(73016), "json/JsonData": () => __webpack_require__(97637), "optimize/ConcatenatedModule": () => __webpack_require__(1881), DelegatedModule: () => __webpack_require__(68719), DependenciesBlock: () => __webpack_require__(21484), DllModule: () => __webpack_require__(52692), ExternalModule: () => __webpack_require__(89805), FileSystemInfo: () => __webpack_require__(13679), InitFragment: () => __webpack_require__(51739), InvalidDependenciesModuleWarning: () => __webpack_require__(2822), Module: () => __webpack_require__(85887), ModuleBuildError: () => __webpack_require__(37991), ModuleDependencyWarning: () => __webpack_require__(61528), ModuleError: () => __webpack_require__(11686), ModuleGraph: () => __webpack_require__(20258), ModuleParseError: () => __webpack_require__(13110), ModuleWarning: () => __webpack_require__(92085), NormalModule: () => __webpack_require__(11026), RawModule: () => __webpack_require__(82329), "sharing/ConsumeSharedModule": () => __webpack_require__(61474), "sharing/ConsumeSharedFallbackDependency": () => __webpack_require__(90489), "sharing/ProvideSharedModule": () => __webpack_require__(65945), "sharing/ProvideSharedDependency": () => __webpack_require__(99355), "sharing/ProvideForSharedDependency": () => __webpack_require__(40235), UnsupportedFeatureWarning: () => __webpack_require__(9532), "util/LazySet": () => __webpack_require__(59534), UnhandledSchemeError: () => __webpack_require__(63859), NodeStuffInWebError: () => __webpack_require__(5771), WebpackError: () => __webpack_require__(68422), "util/registerExternalSerializer": () => { // already registered } }; /***/ }), /***/ 26522: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const { register } = __webpack_require__(99551); class ClassSerializer { constructor(Constructor) { this.Constructor = Constructor; } serialize(obj, context) { obj.serialize(context); } deserialize(context) { if (typeof this.Constructor.deserialize === "function") { return this.Constructor.deserialize(context); } const obj = new this.Constructor(); obj.deserialize(context); return obj; } } module.exports = (Constructor, request, name = null) => { register(Constructor, request, name, new ClassSerializer(Constructor)); }; /***/ }), /***/ 84297: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ /** @template T @typedef {function(): T} FunctionReturning */ /** * @template T * @param {FunctionReturning} fn memorized function * @returns {FunctionReturning} new function */ const memoize = fn => { let cache = false; /** @type {T} */ let result = undefined; return () => { if (cache) { return result; } else { result = fn(); cache = true; // Allow to clean up memory for fn // and all dependent resources fn = undefined; return result; } }; }; module.exports = memoize; /***/ }), /***/ 91679: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const SAFE_LIMIT = 0x80000000; const SAFE_PART = SAFE_LIMIT - 1; const COUNT = 4; const arr = [0, 0, 0, 0, 0]; const primes = [3, 7, 17, 19]; module.exports = (str, range) => { arr.fill(0); for (let i = 0; i < str.length; i++) { const c = str.charCodeAt(i); for (let j = 0; j < COUNT; j++) { const p = (j + COUNT - 1) % COUNT; arr[j] = (arr[j] + c * primes[j] + arr[p]) & SAFE_PART; } for (let j = 0; j < COUNT; j++) { const q = arr[j] % COUNT; arr[j] = arr[j] ^ (arr[q] >> 1); } } if (range <= SAFE_PART) { let sum = 0; for (let j = 0; j < COUNT; j++) { sum = (sum + arr[j]) % range; } return sum; } else { let sum1 = 0; let sum2 = 0; const rangeExt = Math.floor(range / SAFE_LIMIT); for (let j = 0; j < COUNT; j += 2) { sum1 = (sum1 + arr[j]) & SAFE_PART; } for (let j = 1; j < COUNT; j += 2) { sum2 = (sum2 + arr[j]) % rangeExt; } return (sum2 * SAFE_LIMIT + sum1) % range; } }; /***/ }), /***/ 76815: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @template T * @template {Error} E * @param {Iterable} items initial items * @param {number} concurrency number of items running in parallel * @param {function(T, function(T): void, function(E=): void): void} processor worker which pushes more items * @param {function(E=): void} callback all items processed * @returns {void} */ const processAsyncTree = (items, concurrency, processor, callback) => { const queue = Array.from(items); if (queue.length === 0) return callback(); let processing = 0; let finished = false; let processScheduled = true; const push = item => { queue.push(item); if (!processScheduled && processing < concurrency) { processScheduled = true; process.nextTick(processQueue); } }; const processorCallback = err => { processing--; if (err && !finished) { finished = true; callback(err); return; } if (!processScheduled) { processScheduled = true; process.nextTick(processQueue); } }; const processQueue = () => { if (finished) return; while (processing < concurrency && queue.length > 0) { processing++; const item = queue.pop(); processor(item, push, processorCallback); } processScheduled = false; if (queue.length === 0 && processing === 0 && !finished) { finished = true; callback(); } }; processQueue(); }; module.exports = processAsyncTree; /***/ }), /***/ 86709: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const SAFE_IDENTIFIER = /^[_a-zA-Z$][_a-zA-Z$0-9]*$/; const RESERVED_IDENTIFIER = new Set([ "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "return", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "enum", // strict mode "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "yield", // module code "await", // skip future reserved keywords defined under ES1 till ES3 // additional "null", "true", "false" ]); const propertyAccess = (properties, start = 0) => { let str = ""; for (let i = start; i < properties.length; i++) { const p = properties[i]; if (`${+p}` === p) { str += `[${p}]`; } else if (SAFE_IDENTIFIER.test(p) && !RESERVED_IDENTIFIER.has(p)) { str += `.${p}`; } else { str += `[${JSON.stringify(p)}]`; } } return str; }; module.exports = propertyAccess; /***/ }), /***/ 31107: /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { register } = __webpack_require__(99551); const Position = /** @type {TODO} */ __webpack_require__(29089).Position; const SourceLocation = __webpack_require__(29089).SourceLocation; const ValidationError = __webpack_require__(40321)/* .default */ .Z; const { CachedSource, ConcatSource, OriginalSource, PrefixSource, RawSource, ReplaceSource, SourceMapSource } = __webpack_require__(96192); /** @typedef {import("acorn").Position} Position */ /** @typedef {import("../Dependency").RealDependencyLocation} RealDependencyLocation */ /** @typedef {import("../Dependency").SourcePosition} SourcePosition */ /** @typedef {import("./serialization").ObjectDeserializerContext} ObjectDeserializerContext */ /** @typedef {import("./serialization").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {ObjectSerializerContext & { writeLazy?: (any) => void }} WebpackObjectSerializerContext */ const CURRENT_MODULE = "webpack/lib/util/registerExternalSerializer"; register( CachedSource, CURRENT_MODULE, "webpack-sources/CachedSource", new (class CachedSourceSerializer { /** * @param {CachedSource} source the cached source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write, writeLazy }) { if (writeLazy) { writeLazy(source.originalLazy()); } else { write(source.original()); } write(source.getCachedData()); } /** * @param {ObjectDeserializerContext} context context * @returns {CachedSource} cached source */ deserialize({ read }) { const source = read(); const cachedData = read(); return new CachedSource(source, cachedData); } })() ); register( RawSource, CURRENT_MODULE, "webpack-sources/RawSource", new (class RawSourceSerializer { /** * @param {RawSource} source the raw source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.buffer()); write(!source.isBuffer()); } /** * @param {ObjectDeserializerContext} context context * @returns {RawSource} raw source */ deserialize({ read }) { const source = read(); const convertToString = read(); return new RawSource(source, convertToString); } })() ); register( ConcatSource, CURRENT_MODULE, "webpack-sources/ConcatSource", new (class ConcatSourceSerializer { /** * @param {ConcatSource} source the concat source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.getChildren()); } /** * @param {ObjectDeserializerContext} context context * @returns {ConcatSource} concat source */ deserialize({ read }) { const source = new ConcatSource(); source.addAllSkipOptimizing(read()); return source; } })() ); register( PrefixSource, CURRENT_MODULE, "webpack-sources/PrefixSource", new (class PrefixSourceSerializer { /** * @param {PrefixSource} source the prefix source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.getPrefix()); write(source.original()); } /** * @param {ObjectDeserializerContext} context context * @returns {PrefixSource} prefix source */ deserialize({ read }) { return new PrefixSource(read(), read()); } })() ); register( ReplaceSource, CURRENT_MODULE, "webpack-sources/ReplaceSource", new (class ReplaceSourceSerializer { /** * @param {ReplaceSource} source the replace source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.original()); write(source.getName()); const replacements = source.getReplacements(); write(replacements.length); for (const repl of replacements) { write(repl.start); write(repl.end); } for (const repl of replacements) { write(repl.content); write(repl.name); } } /** * @param {ObjectDeserializerContext} context context * @returns {ReplaceSource} replace source */ deserialize({ read }) { const source = new ReplaceSource(read(), read()); const len = read(); const startEndBuffer = []; for (let i = 0; i < len; i++) { startEndBuffer.push(read(), read()); } let j = 0; for (let i = 0; i < len; i++) { source.replace( startEndBuffer[j++], startEndBuffer[j++], read(), read() ); } return source; } })() ); register( OriginalSource, CURRENT_MODULE, "webpack-sources/OriginalSource", new (class OriginalSourceSerializer { /** * @param {OriginalSource} source the original source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.buffer()); write(source.getName()); } /** * @param {ObjectDeserializerContext} context context * @returns {OriginalSource} original source */ deserialize({ read }) { const buffer = read(); const name = read(); return new OriginalSource(buffer, name); } })() ); register( SourceLocation, CURRENT_MODULE, "acorn/SourceLocation", new (class SourceLocationSerializer { /** * @param {SourceLocation} loc the location to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(loc, { write }) { write(loc.start.line); write(loc.start.column); write(loc.end.line); write(loc.end.column); } /** * @param {ObjectDeserializerContext} context context * @returns {RealDependencyLocation} location */ deserialize({ read }) { return { start: { line: read(), column: read() }, end: { line: read(), column: read() } }; } })() ); register( Position, CURRENT_MODULE, "acorn/Position", new (class PositionSerializer { /** * @param {Position} pos the position to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(pos, { write }) { write(pos.line); write(pos.column); } /** * @param {ObjectDeserializerContext} context context * @returns {SourcePosition} position */ deserialize({ read }) { return { line: read(), column: read() }; } })() ); register( SourceMapSource, CURRENT_MODULE, "webpack-sources/SourceMapSource", new (class SourceMapSourceSerializer { /** * @param {SourceMapSource} source the source map source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(source, { write }) { write(source.getArgsAsBuffers()); } /** * @param {ObjectDeserializerContext} context context * @returns {SourceMapSource} source source map source */ deserialize({ read }) { // @ts-expect-error return new SourceMapSource(...read()); } })() ); register( ValidationError, CURRENT_MODULE, "schema-utils/ValidationError", new (class ValidationErrorSerializer { // TODO error should be ValidationError, but this fails the type checks /** * @param {TODO} error the source map source to be serialized * @param {WebpackObjectSerializerContext} context context * @returns {void} */ serialize(error, { write }) { write(error.errors); write(error.schema); write({ name: error.headerName, baseDataPath: error.baseDataPath, postFormatter: error.postFormatter }); } /** * @param {ObjectDeserializerContext} context context * @returns {TODO} error */ deserialize({ read }) { return new ValidationError(read(), read(), read()); } })() ); /***/ }), /***/ 19655: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const SortableSet = __webpack_require__(67563); /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Entrypoint").EntryOptions} EntryOptions */ /** @typedef {string | SortableSet | undefined} RuntimeSpec */ /** @typedef {RuntimeSpec | boolean} RuntimeCondition */ /** * @param {Compilation} compilation the compilation * @param {string} name name of the entry * @param {EntryOptions=} options optionally already received entry options * @returns {RuntimeSpec} runtime */ exports.getEntryRuntime = (compilation, name, options) => { let dependOn; let runtime; if (options) { ({ dependOn, runtime } = options); } else { const entry = compilation.entries.get(name); if (!entry) return name; ({ dependOn, runtime } = entry.options); } if (dependOn) { /** @type {RuntimeSpec} */ let result = undefined; const queue = new Set(dependOn); for (const name of queue) { const dep = compilation.entries.get(name); if (!dep) continue; const { dependOn, runtime } = dep.options; if (dependOn) { for (const name of dependOn) { queue.add(name); } } else { result = mergeRuntimeOwned(result, runtime || name); } } return result || name; } else { return runtime || name; } }; /** * @param {RuntimeSpec} runtime runtime * @param {function(string): void} fn functor * @param {boolean} deterministicOrder enforce a deterministic order * @returns {void} */ exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => { if (runtime === undefined) { fn(undefined); } else if (typeof runtime === "string") { fn(runtime); } else { if (deterministicOrder) runtime.sort(); for (const r of runtime) { fn(r); } } }; const getRuntimesKey = set => { set.sort(); return Array.from(set).join("\n"); }; /** * @param {RuntimeSpec} runtime runtime(s) * @returns {string} key of runtimes */ const getRuntimeKey = runtime => { if (runtime === undefined) return "*"; if (typeof runtime === "string") return runtime; return runtime.getFromUnorderedCache(getRuntimesKey); }; exports.getRuntimeKey = getRuntimeKey; /** * @param {string} key key of runtimes * @returns {RuntimeSpec} runtime(s) */ const keyToRuntime = key => { if (key === "*") return undefined; const items = key.split("\n"); if (items.length === 1) return items[0]; return new SortableSet(items); }; exports.keyToRuntime = keyToRuntime; const getRuntimesString = set => { set.sort(); return Array.from(set).join("+"); }; /** * @param {RuntimeSpec} runtime runtime(s) * @returns {string} readable version */ const runtimeToString = runtime => { if (runtime === undefined) return "*"; if (typeof runtime === "string") return runtime; return runtime.getFromUnorderedCache(getRuntimesString); }; exports.runtimeToString = runtimeToString; /** * @param {RuntimeCondition} runtimeCondition runtime condition * @returns {string} readable version */ exports.runtimeConditionToString = runtimeCondition => { if (runtimeCondition === true) return "true"; if (runtimeCondition === false) return "false"; return runtimeToString(runtimeCondition); }; /** * @param {RuntimeSpec} a first * @param {RuntimeSpec} b second * @returns {boolean} true, when they are equal */ const runtimeEqual = (a, b) => { if (a === b) { return true; } else if ( a === undefined || b === undefined || typeof a === "string" || typeof b === "string" ) { return false; } else if (a.size !== b.size) { return false; } else { a.sort(); b.sort(); const aIt = a[Symbol.iterator](); const bIt = b[Symbol.iterator](); for (;;) { const aV = aIt.next(); if (aV.done) return true; const bV = bIt.next(); if (aV.value !== bV.value) return false; } } }; exports.runtimeEqual = runtimeEqual; /** * @param {RuntimeSpec} a first * @param {RuntimeSpec} b second * @returns {-1|0|1} compare */ exports.compareRuntime = (a, b) => { if (a === b) { return 0; } else if (a === undefined) { return -1; } else if (b === undefined) { return 1; } else { const aKey = getRuntimeKey(a); const bKey = getRuntimeKey(b); if (aKey < bKey) return -1; if (aKey > bKey) return 1; return 0; } }; /** * @param {RuntimeSpec} a first * @param {RuntimeSpec} b second * @returns {RuntimeSpec} merged */ const mergeRuntime = (a, b) => { if (a === undefined) { return b; } else if (b === undefined) { return a; } else if (a === b) { return a; } else if (typeof a === "string") { if (typeof b === "string") { const set = new SortableSet(); set.add(a); set.add(b); return set; } else if (b.has(a)) { return b; } else { const set = new SortableSet(b); set.add(a); return set; } } else { if (typeof b === "string") { if (a.has(b)) return a; const set = new SortableSet(a); set.add(b); return set; } else { const set = new SortableSet(a); for (const item of b) set.add(item); if (set.size === a.size) return a; return set; } } }; exports.mergeRuntime = mergeRuntime; /** * @param {RuntimeCondition} a first * @param {RuntimeCondition} b second * @param {RuntimeSpec} runtime full runtime * @returns {RuntimeCondition} result */ exports.mergeRuntimeCondition = (a, b, runtime) => { if (a === false) return b; if (b === false) return a; if (a === true || b === true) return true; const merged = mergeRuntime(a, b); if (merged === undefined) return undefined; if (typeof merged === "string") { if (typeof runtime === "string" && merged === runtime) return true; return merged; } if (typeof runtime === "string" || runtime === undefined) return merged; if (merged.size === runtime.size) return true; return merged; }; /** * @param {RuntimeSpec | true} a first * @param {RuntimeSpec | true} b second * @param {RuntimeSpec} runtime full runtime * @returns {RuntimeSpec | true} result */ exports.mergeRuntimeConditionNonFalse = (a, b, runtime) => { if (a === true || b === true) return true; const merged = mergeRuntime(a, b); if (merged === undefined) return undefined; if (typeof merged === "string") { if (typeof runtime === "string" && merged === runtime) return true; return merged; } if (typeof runtime === "string" || runtime === undefined) return merged; if (merged.size === runtime.size) return true; return merged; }; /** * @param {RuntimeSpec} a first (may be modified) * @param {RuntimeSpec} b second * @returns {RuntimeSpec} merged */ const mergeRuntimeOwned = (a, b) => { if (b === undefined) { return a; } else if (a === b) { return a; } else if (a === undefined) { if (typeof b === "string") { return b; } else { return new SortableSet(b); } } else if (typeof a === "string") { if (typeof b === "string") { const set = new SortableSet(); set.add(a); set.add(b); return set; } else { const set = new SortableSet(b); set.add(a); return set; } } else { if (typeof b === "string") { a.add(b); return a; } else { for (const item of b) a.add(item); return a; } } }; exports.mergeRuntimeOwned = mergeRuntimeOwned; /** * @param {RuntimeSpec} a first * @param {RuntimeSpec} b second * @returns {RuntimeSpec} merged */ exports.intersectRuntime = (a, b) => { if (a === undefined) { return b; } else if (b === undefined) { return a; } else if (a === b) { return a; } else if (typeof a === "string") { if (typeof b === "string") { return undefined; } else if (b.has(a)) { return a; } else { return undefined; } } else { if (typeof b === "string") { if (a.has(b)) return b; return undefined; } else { const set = new SortableSet(); for (const item of b) { if (a.has(item)) set.add(item); } if (set.size === 0) return undefined; if (set.size === 1) for (const item of set) return item; return set; } } }; /** * @param {RuntimeSpec} a first * @param {RuntimeSpec} b second * @returns {RuntimeSpec} result */ const subtractRuntime = (a, b) => { if (a === undefined) { return undefined; } else if (b === undefined) { return a; } else if (a === b) { return undefined; } else if (typeof a === "string") { if (typeof b === "string") { return a; } else if (b.has(a)) { return undefined; } else { return a; } } else { if (typeof b === "string") { if (!a.has(b)) return a; if (a.size === 2) { for (const item of a) { if (item !== b) return item; } } const set = new SortableSet(a); set.delete(b); } else { const set = new SortableSet(); for (const item of a) { if (!b.has(item)) set.add(item); } if (set.size === 0) return undefined; if (set.size === 1) for (const item of set) return item; return set; } } }; exports.subtractRuntime = subtractRuntime; /** * @param {RuntimeCondition} a first * @param {RuntimeCondition} b second * @param {RuntimeSpec} runtime runtime * @returns {RuntimeCondition} result */ exports.subtractRuntimeCondition = (a, b, runtime) => { if (b === true) return false; if (b === false) return a; if (a === false) return false; const result = subtractRuntime(a === true ? runtime : a, b); return result === undefined ? false : result; }; /** * @param {RuntimeSpec} runtime runtime * @param {function(RuntimeSpec): boolean} filter filter function * @returns {boolean | RuntimeSpec} true/false if filter is constant for all runtimes, otherwise runtimes that are active */ exports.filterRuntime = (runtime, filter) => { if (runtime === undefined) return filter(undefined); if (typeof runtime === "string") return filter(runtime); let some = false; let every = true; let result = undefined; for (const r of runtime) { const v = filter(r); if (v) { some = true; result = mergeRuntimeOwned(result, r); } else { every = false; } } if (!some) return false; if (every) return true; return result; }; /** * @template T */ class RuntimeSpecMap { /** * @param {RuntimeSpecMap=} clone copy form this */ constructor(clone) { this._mode = clone ? clone._mode : 0; // 0 = empty, 1 = single entry, 2 = map /** @type {RuntimeSpec} */ this._singleRuntime = clone ? clone._singleRuntime : undefined; /** @type {T} */ this._singleValue = clone ? clone._singleValue : undefined; /** @type {Map | undefined} */ this._map = clone && clone._map ? new Map(clone._map) : undefined; } /** * @param {RuntimeSpec} runtime the runtimes * @returns {T} value */ get(runtime) { switch (this._mode) { case 0: return undefined; case 1: return runtimeEqual(this._singleRuntime, runtime) ? this._singleValue : undefined; default: return this._map.get(getRuntimeKey(runtime)); } } /** * @param {RuntimeSpec} runtime the runtimes * @returns {boolean} true, when the runtime is stored */ has(runtime) { switch (this._mode) { case 0: return false; case 1: return runtimeEqual(this._singleRuntime, runtime); default: return this._map.has(getRuntimeKey(runtime)); } } set(runtime, value) { switch (this._mode) { case 0: this._mode = 1; this._singleRuntime = runtime; this._singleValue = value; break; case 1: if (runtimeEqual(this._singleRuntime, runtime)) { this._singleValue = value; break; } this._mode = 2; this._map = new Map(); this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); this._singleRuntime = undefined; this._singleValue = undefined; /* falls through */ default: this._map.set(getRuntimeKey(runtime), value); } } provide(runtime, computer) { switch (this._mode) { case 0: this._mode = 1; this._singleRuntime = runtime; return (this._singleValue = computer()); case 1: { if (runtimeEqual(this._singleRuntime, runtime)) { return this._singleValue; } this._mode = 2; this._map = new Map(); this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); this._singleRuntime = undefined; this._singleValue = undefined; const newValue = computer(); this._map.set(getRuntimeKey(runtime), newValue); return newValue; } default: { const key = getRuntimeKey(runtime); const value = this._map.get(key); if (value !== undefined) return value; const newValue = computer(); this._map.set(key, newValue); return newValue; } } } delete(runtime) { switch (this._mode) { case 0: return; case 1: if (runtimeEqual(this._singleRuntime, runtime)) { this._mode = 0; this._singleRuntime = undefined; this._singleValue = undefined; } return; default: this._map.delete(getRuntimeKey(runtime)); } } update(runtime, fn) { switch (this._mode) { case 0: throw new Error("runtime passed to update must exist"); case 1: { if (runtimeEqual(this._singleRuntime, runtime)) { this._singleValue = fn(this._singleValue); break; } const newValue = fn(undefined); if (newValue !== undefined) { this._mode = 2; this._map = new Map(); this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); this._singleRuntime = undefined; this._singleValue = undefined; this._map.set(getRuntimeKey(runtime), newValue); } break; } default: { const key = getRuntimeKey(runtime); const oldValue = this._map.get(key); const newValue = fn(oldValue); if (newValue !== oldValue) this._map.set(key, newValue); } } } keys() { switch (this._mode) { case 0: return []; case 1: return [this._singleRuntime]; default: return Array.from(this._map.keys(), keyToRuntime); } } values() { switch (this._mode) { case 0: return [][Symbol.iterator](); case 1: return [this._singleValue][Symbol.iterator](); default: return this._map.values(); } } get size() { if (this._mode <= 1) return this._mode; return this._map.size; } } exports.RuntimeSpecMap = RuntimeSpecMap; class RuntimeSpecSet { constructor(iterable) { /** @type {Map} */ this._map = new Map(); if (iterable) { for (const item of iterable) { this.add(item); } } } add(runtime) { this._map.set(getRuntimeKey(runtime), runtime); } has(runtime) { return this._map.has(getRuntimeKey(runtime)); } [Symbol.iterator]() { return this._map.values(); } get size() { return this._map.size; } } exports.RuntimeSpecSet = RuntimeSpecSet; /***/ }), /***/ 60473: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {(string|number|undefined|[])[]} SemVerRange */ /** * @param {string} str version string * @returns {(string|number|undefined|[])[]} parsed version */ const parseVersion = str => { var splitAndConvert = function (str) { return str.split(".").map(function (item) { // eslint-disable-next-line eqeqeq return +item == item ? +item : item; }); }; var match = /^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(str); /** @type {(string|number|undefined|[])[]} */ var ver = match[1] ? splitAndConvert(match[1]) : []; if (match[2]) { ver.length++; ver.push.apply(ver, splitAndConvert(match[2])); } if (match[3]) { ver.push([]); ver.push.apply(ver, splitAndConvert(match[3])); } return ver; }; exports.parseVersion = parseVersion; /* eslint-disable eqeqeq */ /** * @param {string} a version * @param {string} b version * @returns {boolean} true, iff a < b */ const versionLt = (a, b) => { // @ts-expect-error a = parseVersion(a); // @ts-expect-error b = parseVersion(b); var i = 0; for (;;) { // a b EOA object undefined number string // EOA a == b a < b b < a a < b a < b // object b < a (0) b < a a < b a < b // undefined a < b a < b (0) a < b a < b // number b < a b < a b < a (1) a < b // string b < a b < a b < a b < a (1) // EOA end of array // (0) continue on // (1) compare them via "<" // Handles first row in table if (i >= a.length) return i < b.length && (typeof b[i])[0] != "u"; var aValue = a[i]; var aType = (typeof aValue)[0]; // Handles first column in table if (i >= b.length) return aType == "u"; var bValue = b[i]; var bType = (typeof bValue)[0]; if (aType == bType) { if (aType != "o" && aType != "u" && aValue != bValue) { return aValue < bValue; } i++; } else { // Handles remaining cases if (aType == "o" && bType == "n") return true; return bType == "s" || aType == "u"; } } }; /* eslint-enable eqeqeq */ exports.versionLt = versionLt; /** * @param {string} str range string * @returns {SemVerRange} parsed range */ exports.parseRange = str => { const splitAndConvert = str => { return str.split(".").map(item => (`${+item}` === item ? +item : item)); }; // see https://docs.npmjs.com/misc/semver#range-grammar for grammar const parsePartial = str => { const match = /^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(str); /** @type {(string|number|undefined|[])[]} */ const ver = match[1] ? [0, ...splitAndConvert(match[1])] : [0]; if (match[2]) { ver.length++; ver.push.apply(ver, splitAndConvert(match[2])); } // remove trailing any matchers let last = ver[ver.length - 1]; while ( ver.length && (last === undefined || /^[*xX]$/.test(/** @type {string} */ (last))) ) { ver.pop(); last = ver[ver.length - 1]; } return ver; }; const toFixed = range => { if (range.length === 1) { // Special case for "*" is "x.x.x" instead of "=" return [0]; } else if (range.length === 2) { // Special case for "1" is "1.x.x" instead of "=1" return [1, ...range.slice(1)]; } else if (range.length === 3) { // Special case for "1.2" is "1.2.x" instead of "=1.2" return [2, ...range.slice(1)]; } else { return [range.length, ...range.slice(1)]; } }; const negate = range => { return [-range[0] - 1, ...range.slice(1)]; }; const parseSimple = str => { // simple ::= primitive | partial | tilde | caret // primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial // tilde ::= '~' partial // caret ::= '^' partial const match = /^(\^|~|<=|<|>=|>|=|v|!)/.exec(str); const start = match ? match[0] : ""; const remainder = parsePartial(str.slice(start.length)); switch (start) { case "^": if (remainder.length > 1 && remainder[1] === 0) { if (remainder.length > 2 && remainder[2] === 0) { return [3, ...remainder.slice(1)]; } return [2, ...remainder.slice(1)]; } return [1, ...remainder.slice(1)]; case "~": return [2, ...remainder.slice(1)]; case ">=": return remainder; case "=": case "v": case "": return toFixed(remainder); case "<": return negate(remainder); case ">": { // and( >=, not( = ) ) => >=, =, not, and const fixed = toFixed(remainder); // eslint-disable-next-line no-sparse-arrays return [, fixed, 0, remainder, 2]; } case "<=": // or( <, = ) => <, =, or // eslint-disable-next-line no-sparse-arrays return [, toFixed(remainder), negate(remainder), 1]; case "!": { // not = const fixed = toFixed(remainder); // eslint-disable-next-line no-sparse-arrays return [, fixed, 0]; } default: throw new Error("Unexpected start value"); } }; const combine = (items, fn) => { if (items.length === 1) return items[0]; const arr = []; for (const item of items.slice().reverse()) { if (0 in item) { arr.push(item); } else { arr.push(...item.slice(1)); } } // eslint-disable-next-line no-sparse-arrays return [, ...arr, ...items.slice(1).map(() => fn)]; }; const parseRange = str => { // range ::= hyphen | simple ( ' ' simple ) * | '' // hyphen ::= partial ' - ' partial const items = str.split(" - "); if (items.length === 1) { const items = str.trim().split(/\s+/g).map(parseSimple); return combine(items, 2); } const a = parsePartial(items[0]); const b = parsePartial(items[1]); // >=a <=b => and( >=a, or( >=a, { // range-set ::= range ( logical-or range ) * // logical-or ::= ( ' ' ) * '||' ( ' ' ) * const items = str.split(/\s*\|\|\s*/).map(parseRange); return combine(items, 1); }; return parseLogicalOr(str); }; /* eslint-disable eqeqeq */ const rangeToString = range => { var fixCount = range[0]; var str = ""; if (range.length === 1) { return "*"; } else if (fixCount + 0.5) { str += fixCount == 0 ? ">=" : fixCount == -1 ? "<" : fixCount == 1 ? "^" : fixCount == 2 ? "~" : fixCount > 0 ? "=" : "!="; var needDot = 1; // eslint-disable-next-line no-redeclare for (var i = 1; i < range.length; i++) { var item = range[i]; var t = (typeof item)[0]; needDot--; str += t == "u" ? // undefined: prerelease marker, add an "-" "-" : // number or string: add the item, set flag to add an "." between two of them (needDot > 0 ? "." : "") + ((needDot = 2), item); } return str; } else { var stack = []; // eslint-disable-next-line no-redeclare for (var i = 1; i < range.length; i++) { // eslint-disable-next-line no-redeclare var item = range[i]; stack.push( item === 0 ? "not(" + pop() + ")" : item === 1 ? "(" + pop() + " || " + pop() + ")" : item === 2 ? stack.pop() + " " + stack.pop() : rangeToString(item) ); } return pop(); } function pop() { return stack.pop().replace(/^\((.+)\)$/, "$1"); } }; /* eslint-enable eqeqeq */ exports.rangeToString = rangeToString; /* eslint-disable eqeqeq */ /** * @param {SemVerRange} range version range * @param {string} version the version * @returns {boolean} if version satisfy the range */ const satisfy = (range, version) => { if (0 in range) { // @ts-expect-error version = parseVersion(version); var fixCount = range[0]; // when negated is set it swill set for < instead of >= var negated = fixCount < 0; if (negated) fixCount = -fixCount - 1; for (var i = 0, j = 1, isEqual = true; ; j++, i++) { // cspell:word nequal nequ // when isEqual = true: // range version: EOA/object undefined number string // EOA equal block big-ver big-ver // undefined bigger next big-ver big-ver // number smaller block cmp big-cmp // fixed number smaller block cmp-fix differ // string smaller block differ cmp // fixed string smaller block small-cmp cmp-fix // when isEqual = false: // range version: EOA/object undefined number string // EOA nequal block next-ver next-ver // undefined nequal block next-ver next-ver // number nequal block next next // fixed number nequal block next next (this never happens) // string nequal block next next // fixed string nequal block next next (this never happens) // EOA end of array // equal (version is equal range): // when !negated: return true, // when negated: return false // bigger (version is bigger as range): // when fixed: return false, // when !negated: return true, // when negated: return false, // smaller (version is smaller as range): // when !negated: return false, // when negated: return true // nequal (version is not equal range (> resp <)): return true // block (version is in different prerelease area): return false // differ (version is different from fixed range (string vs. number)): return false // next: continues to the next items // next-ver: when fixed: return false, continues to the next item only for the version, sets isEqual=false // big-ver: when fixed || negated: return false, continues to the next item only for the version, sets isEqual=false // next-nequ: continues to the next items, sets isEqual=false // cmp (negated === false): version < range => return false, version > range => next-nequ, else => next // cmp (negated === true): version > range => return false, version < range => next-nequ, else => next // cmp-fix: version == range => next, else => return false // big-cmp: when negated => return false, else => next-nequ // small-cmp: when negated => next-nequ, else => return false var rangeType = j < range.length ? (typeof range[j])[0] : ""; var versionValue; var versionType; // Handles first column in both tables (end of version or object) if ( i >= version.length || ((versionValue = version[i]), (versionType = (typeof versionValue)[0]) == "o") ) { // Handles nequal if (!isEqual) return true; // Handles bigger if (rangeType == "u") return j > fixCount && !negated; // Handles equal and smaller: (range === EOA) XOR negated return (rangeType == "") != negated; // equal + smaller } // Handles second column in both tables (version = undefined) if (versionType == "u") { if (!isEqual || rangeType != "u") { return false; } } // switch between first and second table else if (isEqual) { // Handle diagonal if (rangeType == versionType) { if (j <= fixCount) { // Handles "cmp-fix" cases if (versionValue != range[j]) { return false; } } else { // Handles "cmp" cases if (negated ? versionValue > range[j] : versionValue < range[j]) { return false; } if (versionValue != range[j]) isEqual = false; } } // Handle big-ver else if (rangeType != "s" && rangeType != "n") { if (negated || j <= fixCount) return false; isEqual = false; j--; } // Handle differ, big-cmp and small-cmp else if (j <= fixCount || versionType < rangeType != negated) { return false; } else { isEqual = false; } } else { // Handles all "next-ver" cases in the second table if (rangeType != "s" && rangeType != "n") { isEqual = false; j--; } // next is applied by default } } } /** @type {(boolean | number)[]} */ var stack = []; var p = stack.pop.bind(stack); // eslint-disable-next-line no-redeclare for (var i = 1; i < range.length; i++) { var item = /** @type {SemVerRange | 0 | 1 | 2} */ (range[i]); stack.push( item == 1 ? p() | p() : item == 2 ? p() & p() : item ? satisfy(item, version) : !p() ); } return !!p(); }; /* eslint-enable eqeqeq */ exports.satisfy = satisfy; exports.stringifyHoley = json => { switch (typeof json) { case "undefined": return ""; case "object": if (Array.isArray(json)) { let str = "["; for (let i = 0; i < json.length; i++) { if (i !== 0) str += ","; str += this.stringifyHoley(json[i]); } str += "]"; return str; } else { return JSON.stringify(json); } default: return JSON.stringify(json); } }; //#region runtime code: parseVersion exports.parseVersionRuntimeCode = runtimeTemplate => `var parseVersion = ${runtimeTemplate.basicFunction("str", [ "// see webpack/lib/util/semver.js for original code", `var p=${ runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)" }{return p.split(".").map((${ runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)" }{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;` ])}`; //#endregion //#region runtime code: versionLt exports.versionLtRuntimeCode = runtimeTemplate => `var versionLt = ${runtimeTemplate.basicFunction("a, b", [ "// see webpack/lib/util/semver.js for original code", 'a=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return"u"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return"o"==n&&"n"==f||("s"==f||"u"==n);if("o"!=n&&"u"!=n&&e!=t)return e `var rangeToString = ${runtimeTemplate.basicFunction("range", [ "// see webpack/lib/util/semver.js for original code", 'var r=range[0],n="";if(1===range.length)return"*";if(r+.5){n+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var e=1,a=1;a0?".":"")+(e=2,t)}return n}var g=[];for(a=1;a `var satisfy = ${runtimeTemplate.basicFunction("range, version", [ "// see webpack/lib/util/semver.js for original code", 'if(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i=version.length||"o"==(s=(typeof(f=version[n]))[0]))return!a||("u"==g?i>e&&!r:""==g!=r);if("u"==s){if(!a||"u"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f __webpack_require__(7732) ); const getObjectMiddleware = memoize(() => __webpack_require__(77815) ); const getSingleItemMiddleware = memoize(() => __webpack_require__(63340) ); const getSerializer = memoize(() => __webpack_require__(24754)); const getSerializerMiddleware = memoize(() => __webpack_require__(37063) ); const getBinaryMiddlewareInstance = memoize( () => new (getBinaryMiddleware())() ); const registerSerializers = memoize(() => { __webpack_require__(31107); // Load internal paths with a relative require // This allows bundling all internal serializers const internalSerializables = __webpack_require__(7679); getObjectMiddleware().registerLoader(/^webpack\/lib\//, req => { const loader = internalSerializables[req.slice("webpack/lib/".length)]; if (loader) { loader(); } else { console.warn(`${req} not found in internalSerializables`); } return true; }); }); /** @type {Serializer} */ let buffersSerializer; // Expose serialization API module.exports = { get register() { return getObjectMiddleware().register; }, get registerLoader() { return getObjectMiddleware().registerLoader; }, get registerNotSerializable() { return getObjectMiddleware().registerNotSerializable; }, get NOT_SERIALIZABLE() { return getObjectMiddleware().NOT_SERIALIZABLE; }, /** @type {MEASURE_START_OPERATION} */ get MEASURE_START_OPERATION() { return getBinaryMiddleware().MEASURE_START_OPERATION; }, /** @type {MEASURE_END_OPERATION} */ get MEASURE_END_OPERATION() { return getBinaryMiddleware().MEASURE_END_OPERATION; }, get buffersSerializer() { if (buffersSerializer !== undefined) return buffersSerializer; registerSerializers(); const Serializer = getSerializer(); const binaryMiddleware = getBinaryMiddlewareInstance(); const SerializerMiddleware = getSerializerMiddleware(); const SingleItemMiddleware = getSingleItemMiddleware(); return (buffersSerializer = new Serializer([ new SingleItemMiddleware(), new (getObjectMiddleware())(context => { if (context.write) { context.writeLazy = value => { context.write( SerializerMiddleware.createLazy(value, binaryMiddleware) ); }; } }, "md4"), binaryMiddleware ])); }, createFileSerializer: (fs, hashFunction) => { registerSerializers(); const Serializer = getSerializer(); const FileMiddleware = __webpack_require__(40572); const fileMiddleware = new FileMiddleware(fs, hashFunction); const binaryMiddleware = getBinaryMiddlewareInstance(); const SerializerMiddleware = getSerializerMiddleware(); const SingleItemMiddleware = getSingleItemMiddleware(); return new Serializer([ new SingleItemMiddleware(), new (getObjectMiddleware())(context => { if (context.write) { context.writeLazy = value => { context.write( SerializerMiddleware.createLazy(value, binaryMiddleware) ); }; context.writeSeparate = (value, options) => { const lazy = SerializerMiddleware.createLazy( value, fileMiddleware, options ); context.write(lazy); return lazy; }; } }, hashFunction), binaryMiddleware, fileMiddleware ]); } }; /***/ }), /***/ 84820: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** * @typedef {Object} GroupOptions * @property {boolean=} groupChildren * @property {boolean=} force * @property {number=} targetGroupCount */ /** * @template T * @template R * @typedef {Object} GroupConfig * @property {function(T): string[]} getKeys * @property {function(string, (R | T)[], T[]): R} createGroup * @property {function(string, T[]): GroupOptions=} getOptions */ /** * @template T * @template R * @typedef {Object} ItemWithGroups * @property {T} item * @property {Set>} groups */ /** * @template T * @template R * @typedef {{ config: GroupConfig, name: string, alreadyGrouped: boolean, items: Set> | undefined }} Group */ /** * @template T * @template R * @param {T[]} items the list of items * @param {GroupConfig[]} groupConfigs configuration * @returns {(R | T)[]} grouped items */ const smartGrouping = (items, groupConfigs) => { /** @type {Set>} */ const itemsWithGroups = new Set(); /** @type {Map>} */ const allGroups = new Map(); for (const item of items) { /** @type {Set>} */ const groups = new Set(); for (let i = 0; i < groupConfigs.length; i++) { const groupConfig = groupConfigs[i]; const keys = groupConfig.getKeys(item); if (keys) { for (const name of keys) { const key = `${i}:${name}`; let group = allGroups.get(key); if (group === undefined) { allGroups.set( key, (group = { config: groupConfig, name, alreadyGrouped: false, items: undefined }) ); } groups.add(group); } } } itemsWithGroups.add({ item, groups }); } /** * @param {Set>} itemsWithGroups input items with groups * @returns {(T | R)[]} groups items */ const runGrouping = itemsWithGroups => { const totalSize = itemsWithGroups.size; for (const entry of itemsWithGroups) { for (const group of entry.groups) { if (group.alreadyGrouped) continue; const items = group.items; if (items === undefined) { group.items = new Set([entry]); } else { items.add(entry); } } } /** @type {Map, { items: Set>, options: GroupOptions | false | undefined, used: boolean }>} */ const groupMap = new Map(); for (const group of allGroups.values()) { if (group.items) { const items = group.items; group.items = undefined; groupMap.set(group, { items, options: undefined, used: false }); } } /** @type {(T | R)[]} */ const results = []; for (;;) { /** @type {Group} */ let bestGroup = undefined; let bestGroupSize = -1; let bestGroupItems = undefined; let bestGroupOptions = undefined; for (const [group, state] of groupMap) { const { items, used } = state; let options = state.options; if (options === undefined) { const groupConfig = group.config; state.options = options = (groupConfig.getOptions && groupConfig.getOptions( group.name, Array.from(items, ({ item }) => item) )) || false; } const force = options && options.force; if (!force) { if (bestGroupOptions && bestGroupOptions.force) continue; if (used) continue; if (items.size <= 1 || totalSize - items.size <= 1) { continue; } } const targetGroupCount = (options && options.targetGroupCount) || 4; let sizeValue = force ? items.size : Math.min( items.size, (totalSize * 2) / targetGroupCount + itemsWithGroups.size - items.size ); if ( sizeValue > bestGroupSize || (force && (!bestGroupOptions || !bestGroupOptions.force)) ) { bestGroup = group; bestGroupSize = sizeValue; bestGroupItems = items; bestGroupOptions = options; } } if (bestGroup === undefined) { break; } const items = new Set(bestGroupItems); const options = bestGroupOptions; const groupChildren = !options || options.groupChildren !== false; for (const item of items) { itemsWithGroups.delete(item); // Remove all groups that items have from the map to not select them again for (const group of item.groups) { const state = groupMap.get(group); if (state !== undefined) { state.items.delete(item); if (state.items.size === 0) { groupMap.delete(group); } else { state.options = undefined; if (groupChildren) { state.used = true; } } } } } groupMap.delete(bestGroup); const key = bestGroup.name; const groupConfig = bestGroup.config; const allItems = Array.from(items, ({ item }) => item); bestGroup.alreadyGrouped = true; const children = groupChildren ? runGrouping(items) : allItems; bestGroup.alreadyGrouped = false; results.push(groupConfig.createGroup(key, children, allItems)); } for (const { item } of itemsWithGroups) { results.push(item); } return results; }; return runGrouping(itemsWithGroups); }; module.exports = smartGrouping; /***/ }), /***/ 4002: /***/ (function(__unused_webpack_module, exports) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("webpack-sources").Source} Source */ /** @type {WeakMap>} */ const equalityCache = new WeakMap(); /** * @param {Source} a a source * @param {Source} b another source * @returns {boolean} true, when both sources are equal */ const _isSourceEqual = (a, b) => { // prefer .buffer(), it's called anyway during emit /** @type {Buffer|string} */ let aSource = typeof a.buffer === "function" ? a.buffer() : a.source(); /** @type {Buffer|string} */ let bSource = typeof b.buffer === "function" ? b.buffer() : b.source(); if (aSource === bSource) return true; if (typeof aSource === "string" && typeof bSource === "string") return false; if (!Buffer.isBuffer(aSource)) aSource = Buffer.from(aSource, "utf-8"); if (!Buffer.isBuffer(bSource)) bSource = Buffer.from(bSource, "utf-8"); return aSource.equals(bSource); }; /** * @param {Source} a a source * @param {Source} b another source * @returns {boolean} true, when both sources are equal */ const isSourceEqual = (a, b) => { if (a === b) return true; const cache1 = equalityCache.get(a); if (cache1 !== undefined) { const result = cache1.get(b); if (result !== undefined) return result; } const result = _isSourceEqual(a, b); if (cache1 !== undefined) { cache1.set(b, result); } else { const map = new WeakMap(); map.set(b, result); equalityCache.set(a, map); } const cache2 = equalityCache.get(b); if (cache2 !== undefined) { cache2.set(a, result); } else { const map = new WeakMap(); map.set(a, result); equalityCache.set(b, map); } return result; }; exports.isSourceEqual = isSourceEqual; /***/ }), /***/ 55959: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { validate } = __webpack_require__(79286); /* cSpell:disable */ const DID_YOU_MEAN = { rules: "module.rules", loaders: "module.rules or module.rules.*.use", query: "module.rules.*.options (BREAKING CHANGE since webpack 5)", noParse: "module.noParse", filename: "output.filename or module.rules.*.generator.filename", file: "output.filename", chunkFilename: "output.chunkFilename", chunkfilename: "output.chunkFilename", ecmaVersion: "output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", ecmaversion: "output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", ecma: "output.environment (output.ecmaVersion was a temporary configuration option during webpack 5 beta)", path: "output.path", pathinfo: "output.pathinfo", pathInfo: "output.pathinfo", jsonpFunction: "output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)", chunkCallbackName: "output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)", jsonpScriptType: "output.scriptType (BREAKING CHANGE since webpack 5)", hotUpdateFunction: "output.hotUpdateGlobal (BREAKING CHANGE since webpack 5)", splitChunks: "optimization.splitChunks", immutablePaths: "snapshot.immutablePaths", managedPaths: "snapshot.managedPaths", maxModules: "stats.modulesSpace (BREAKING CHANGE since webpack 5)", hashedModuleIds: 'optimization.moduleIds: "hashed" (BREAKING CHANGE since webpack 5)', namedChunks: 'optimization.chunkIds: "named" (BREAKING CHANGE since webpack 5)', namedModules: 'optimization.moduleIds: "named" (BREAKING CHANGE since webpack 5)', occurrenceOrder: 'optimization.chunkIds: "size" and optimization.moduleIds: "size" (BREAKING CHANGE since webpack 5)', automaticNamePrefix: "optimization.splitChunks.[cacheGroups.*].idHint (BREAKING CHANGE since webpack 5)", noEmitOnErrors: "optimization.emitOnErrors (BREAKING CHANGE since webpack 5: logic is inverted to avoid negative flags)", Buffer: "to use the ProvidePlugin to process the Buffer variable to modules as polyfill\n" + "BREAKING CHANGE: webpack 5 no longer provided Node.js polyfills by default.\n" + "Note: if you are using 'node.Buffer: false', you can just remove that as this is the default behavior now.\n" + "To provide a polyfill to modules use:\n" + 'new ProvidePlugin({ Buffer: ["buffer", "Buffer"] }) and npm install buffer.', process: "to use the ProvidePlugin to process the process variable to modules as polyfill\n" + "BREAKING CHANGE: webpack 5 no longer provided Node.js polyfills by default.\n" + "Note: if you are using 'node.process: false', you can just remove that as this is the default behavior now.\n" + "To provide a polyfill to modules use:\n" + 'new ProvidePlugin({ process: "process" }) and npm install buffer.' }; const REMOVED = { concord: "BREAKING CHANGE: resolve.concord has been removed and is no longer available.", devtoolLineToLine: "BREAKING CHANGE: output.devtoolLineToLine has been removed and is no longer available." }; /* cSpell:enable */ /** * @param {Parameters[0]} schema a json schema * @param {Parameters[1]} options the options that should be validated * @param {Parameters[2]=} validationConfiguration configuration for generating errors * @returns {void} */ const validateSchema = (schema, options, validationConfiguration) => { validate( schema, options, validationConfiguration || { name: "Webpack", postFormatter: (formattedError, error) => { const children = error.children; if ( children && children.some( child => child.keyword === "absolutePath" && child.dataPath === ".output.filename" ) ) { return `${formattedError}\nPlease use output.path to specify absolute path and output.filename for the file name.`; } if ( children && children.some( child => child.keyword === "pattern" && child.dataPath === ".devtool" ) ) { return ( `${formattedError}\n` + "BREAKING CHANGE since webpack 5: The devtool option is more strict.\n" + "Please strictly follow the order of the keywords in the pattern." ); } if (error.keyword === "additionalProperties") { const params = /** @type {import("ajv").AdditionalPropertiesParams} */ ( error.params ); if ( Object.prototype.hasOwnProperty.call( DID_YOU_MEAN, params.additionalProperty ) ) { return `${formattedError}\nDid you mean ${ DID_YOU_MEAN[params.additionalProperty] }?`; } if ( Object.prototype.hasOwnProperty.call( REMOVED, params.additionalProperty ) ) { return `${formattedError}\n${REMOVED[params.additionalProperty]}?`; } if (!error.dataPath) { if (params.additionalProperty === "debug") { return ( `${formattedError}\n` + "The 'debug' property was removed in webpack 2.0.0.\n" + "Loaders should be updated to allow passing this option via loader options in module.rules.\n" + "Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:\n" + "plugins: [\n" + " new webpack.LoaderOptionsPlugin({\n" + " debug: true\n" + " })\n" + "]" ); } if (params.additionalProperty) { return ( `${formattedError}\n` + "For typos: please correct them.\n" + "For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.\n" + " Loaders should be updated to allow passing options via loader options in module.rules.\n" + " Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:\n" + " plugins: [\n" + " new webpack.LoaderOptionsPlugin({\n" + " // test: /\\.xxx$/, // may apply this only for some modules\n" + " options: {\n" + ` ${params.additionalProperty}: …\n` + " }\n" + " })\n" + " ]" ); } } } return formattedError; } } ); }; module.exports = validateSchema; /***/ }), /***/ 84465: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); class AsyncWasmLoadingRuntimeModule extends RuntimeModule { constructor({ generateLoadBinaryCode, supportsStreaming }) { super("wasm loading", RuntimeModule.STAGE_NORMAL); this.generateLoadBinaryCode = generateLoadBinaryCode; this.supportsStreaming = supportsStreaming; } /** * @returns {string} runtime code */ generate() { const { compilation, chunk } = this; const { outputOptions, runtimeTemplate } = compilation; const fn = RuntimeGlobals.instantiateWasm; const wasmModuleSrcPath = compilation.getPath( JSON.stringify(outputOptions.webassemblyModuleFilename), { hash: `" + ${RuntimeGlobals.getFullHash}() + "`, hashWithLength: length => `" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`, module: { id: '" + wasmModuleId + "', hash: `" + wasmModuleHash + "`, hashWithLength(length) { return `" + wasmModuleHash.slice(0, ${length}) + "`; } }, runtime: chunk.runtime } ); return `${fn} = ${runtimeTemplate.basicFunction( "exports, wasmModuleId, wasmModuleHash, importsObj", [ `var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`, this.supportsStreaming ? Template.asString([ "if (typeof WebAssembly.instantiateStreaming === 'function') {", Template.indent([ "return WebAssembly.instantiateStreaming(req, importsObj)", Template.indent([ `.then(${runtimeTemplate.returningFunction( "Object.assign(exports, res.instance.exports)", "res" )});` ]) ]), "}" ]) : "// no support for streaming compilation", "return req", Template.indent([ `.then(${runtimeTemplate.returningFunction("x.arrayBuffer()", "x")})`, `.then(${runtimeTemplate.returningFunction( "WebAssembly.instantiate(bytes, importsObj)", "bytes" )})`, `.then(${runtimeTemplate.returningFunction( "Object.assign(exports, res.instance.exports)", "res" )});` ]) ] )};`; } } module.exports = AsyncWasmLoadingRuntimeModule; /***/ }), /***/ 60072: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Generator = __webpack_require__(1826); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ /** @typedef {import("../NormalModule")} NormalModule */ const TYPES = new Set(["webassembly"]); class AsyncWebAssemblyGenerator extends Generator { constructor(options) { super(); this.options = options; } /** * @param {NormalModule} module fresh module * @returns {Set} available types (do not mutate) */ getTypes(module) { return TYPES; } /** * @param {NormalModule} module the module * @param {string=} type source type * @returns {number} estimate size of the module */ getSize(module, type) { const originalSource = module.originalSource(); if (!originalSource) { return 0; } return originalSource.size(); } /** * @param {NormalModule} module module for which the code should be generated * @param {GenerateContext} generateContext context for generate * @returns {Source} generated code */ generate(module, generateContext) { return module.originalSource(); } } module.exports = AsyncWebAssemblyGenerator; /***/ }), /***/ 33838: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { RawSource } = __webpack_require__(96192); const Generator = __webpack_require__(1826); const InitFragment = __webpack_require__(51739); const RuntimeGlobals = __webpack_require__(49404); const Template = __webpack_require__(92066); const WebAssemblyImportDependency = __webpack_require__(97093); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ const TYPES = new Set(["webassembly"]); class AsyncWebAssemblyJavascriptGenerator extends Generator { constructor(filenameTemplate) { super(); this.filenameTemplate = filenameTemplate; } /** * @param {NormalModule} module fresh module * @returns {Set} available types (do not mutate) */ getTypes(module) { return TYPES; } /** * @param {NormalModule} module the module * @param {string=} type source type * @returns {number} estimate size of the module */ getSize(module, type) { return 40 + module.dependencies.length * 10; } /** * @param {NormalModule} module module for which the code should be generated * @param {GenerateContext} generateContext context for generate * @returns {Source} generated code */ generate(module, generateContext) { const { runtimeTemplate, chunkGraph, moduleGraph, runtimeRequirements, runtime } = generateContext; runtimeRequirements.add(RuntimeGlobals.module); runtimeRequirements.add(RuntimeGlobals.moduleId); runtimeRequirements.add(RuntimeGlobals.exports); runtimeRequirements.add(RuntimeGlobals.instantiateWasm); /** @type {InitFragment[]} */ const initFragments = []; /** @type {Map} */ const depModules = new Map(); /** @type {Map} */ const wasmDepsByRequest = new Map(); for (const dep of module.dependencies) { if (dep instanceof WebAssemblyImportDependency) { const module = moduleGraph.getModule(dep); if (!depModules.has(module)) { depModules.set(module, { request: dep.request, importVar: `WEBPACK_IMPORTED_MODULE_${depModules.size}` }); } let list = wasmDepsByRequest.get(dep.request); if (list === undefined) { list = []; wasmDepsByRequest.set(dep.request, list); } list.push(dep); } } const promises = []; const importStatements = Array.from( depModules, ([importedModule, { request, importVar }]) => { if (moduleGraph.isAsync(importedModule)) { promises.push(importVar); } return runtimeTemplate.importStatement({ update: false, module: importedModule, chunkGraph, request, originModule: module, importVar, runtimeRequirements }); } ); const importsCode = importStatements.map(([x]) => x).join(""); const importsCompatCode = importStatements.map(([_, x]) => x).join(""); const importObjRequestItems = Array.from( wasmDepsByRequest, ([request, deps]) => { const exportItems = deps.map(dep => { const importedModule = moduleGraph.getModule(dep); const importVar = depModules.get(importedModule).importVar; return `${JSON.stringify( dep.name )}: ${runtimeTemplate.exportFromImport({ moduleGraph, module: importedModule, request, exportName: dep.name, originModule: module, asiSafe: true, isCall: false, callContext: false, defaultInterop: true, importVar, initFragments, runtime, runtimeRequirements })}`; }); return Template.asString([ `${JSON.stringify(request)}: {`, Template.indent(exportItems.join(",\n")), "}" ]); } ); const importsObj = importObjRequestItems.length > 0 ? Template.asString([ "{", Template.indent(importObjRequestItems.join(",\n")), "}" ]) : undefined; const instantiateCall = `${RuntimeGlobals.instantiateWasm}(${module.exportsArgument}, ${ module.moduleArgument }.id, ${JSON.stringify( chunkGraph.getRenderedModuleHash(module, runtime) )}` + (importsObj ? `, ${importsObj})` : `)`); if (promises.length > 0) runtimeRequirements.add(RuntimeGlobals.asyncModule); const source = new RawSource( promises.length > 0 ? Template.asString([ `var __webpack_instantiate__ = ${runtimeTemplate.basicFunction( `[${promises.join(", ")}]`, `${importsCompatCode}return ${instantiateCall};` )}`, `${RuntimeGlobals.asyncModule}(${ module.moduleArgument }, ${runtimeTemplate.basicFunction( "__webpack_handle_async_dependencies__", [ importsCode, `var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([${promises.join( ", " )}]);`, "return __webpack_async_dependencies__.then ? __webpack_async_dependencies__.then(__webpack_instantiate__) : __webpack_instantiate__(__webpack_async_dependencies__);" ] )}, 1);` ]) : `${importsCode}${importsCompatCode}module.exports = ${instantiateCall};` ); return InitFragment.addToSource(source, initFragments, generateContext); } } module.exports = AsyncWebAssemblyJavascriptGenerator; /***/ }), /***/ 13804: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { SyncWaterfallHook } = __webpack_require__(34718); const Compilation = __webpack_require__(59622); const Generator = __webpack_require__(1826); const { tryRunOrWebpackError } = __webpack_require__(89935); const WebAssemblyImportDependency = __webpack_require__(97093); const { compareModulesByIdentifier } = __webpack_require__(26296); const memoize = __webpack_require__(84297); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("../Template").RenderManifestEntry} RenderManifestEntry */ /** @typedef {import("../Template").RenderManifestOptions} RenderManifestOptions */ const getAsyncWebAssemblyGenerator = memoize(() => __webpack_require__(60072) ); const getAsyncWebAssemblyJavascriptGenerator = memoize(() => __webpack_require__(33838) ); const getAsyncWebAssemblyParser = memoize(() => __webpack_require__(20595) ); /** * @typedef {Object} WebAssemblyRenderContext * @property {Chunk} chunk the chunk * @property {DependencyTemplates} dependencyTemplates the dependency templates * @property {RuntimeTemplate} runtimeTemplate the runtime template * @property {ModuleGraph} moduleGraph the module graph * @property {ChunkGraph} chunkGraph the chunk graph * @property {CodeGenerationResults} codeGenerationResults results of code generation */ /** * @typedef {Object} CompilationHooks * @property {SyncWaterfallHook<[Source, Module, WebAssemblyRenderContext]>} renderModuleContent */ /** @type {WeakMap} */ const compilationHooksMap = new WeakMap(); class AsyncWebAssemblyModulesPlugin { /** * @param {Compilation} compilation the compilation * @returns {CompilationHooks} the attached hooks */ static getCompilationHooks(compilation) { if (!(compilation instanceof Compilation)) { throw new TypeError( "The 'compilation' argument must be an instance of Compilation" ); } let hooks = compilationHooksMap.get(compilation); if (hooks === undefined) { hooks = { renderModuleContent: new SyncWaterfallHook([ "source", "module", "renderContext" ]) }; compilationHooksMap.set(compilation, hooks); } return hooks; } constructor(options) { this.options = options; } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap( "AsyncWebAssemblyModulesPlugin", (compilation, { normalModuleFactory }) => { const hooks = AsyncWebAssemblyModulesPlugin.getCompilationHooks(compilation); compilation.dependencyFactories.set( WebAssemblyImportDependency, normalModuleFactory ); normalModuleFactory.hooks.createParser .for("webassembly/async") .tap("AsyncWebAssemblyModulesPlugin", () => { const AsyncWebAssemblyParser = getAsyncWebAssemblyParser(); return new AsyncWebAssemblyParser(); }); normalModuleFactory.hooks.createGenerator .for("webassembly/async") .tap("AsyncWebAssemblyModulesPlugin", () => { const AsyncWebAssemblyJavascriptGenerator = getAsyncWebAssemblyJavascriptGenerator(); const AsyncWebAssemblyGenerator = getAsyncWebAssemblyGenerator(); return Generator.byType({ javascript: new AsyncWebAssemblyJavascriptGenerator( compilation.outputOptions.webassemblyModuleFilename ), webassembly: new AsyncWebAssemblyGenerator(this.options) }); }); compilation.hooks.renderManifest.tap( "WebAssemblyModulesPlugin", (result, options) => { const { moduleGraph, chunkGraph, runtimeTemplate } = compilation; const { chunk, outputOptions, dependencyTemplates, codeGenerationResults } = options; for (const module of chunkGraph.getOrderedChunkModulesIterable( chunk, compareModulesByIdentifier )) { if (module.type === "webassembly/async") { const filenameTemplate = outputOptions.webassemblyModuleFilename; result.push({ render: () => this.renderModule( module, { chunk, dependencyTemplates, runtimeTemplate, moduleGraph, chunkGraph, codeGenerationResults }, hooks ), filenameTemplate, pathOptions: { module, runtime: chunk.runtime, chunkGraph }, auxiliary: true, identifier: `webassemblyAsyncModule${chunkGraph.getModuleId( module )}`, hash: chunkGraph.getModuleHash(module, chunk.runtime) }); } } return result; } ); } ); } renderModule(module, renderContext, hooks) { const { codeGenerationResults, chunk } = renderContext; try { const moduleSource = codeGenerationResults.getSource( module, chunk.runtime, "webassembly" ); return tryRunOrWebpackError( () => hooks.renderModuleContent.call(moduleSource, module, renderContext), "AsyncWebAssemblyModulesPlugin.getCompilationHooks().renderModuleContent" ); } catch (e) { e.module = module; throw e; } } } module.exports = AsyncWebAssemblyModulesPlugin; /***/ }), /***/ 20595: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const t = __webpack_require__(98688); const { decode } = __webpack_require__(8062); const Parser = __webpack_require__(68214); const StaticExportsDependency = __webpack_require__(67967); const WebAssemblyImportDependency = __webpack_require__(97093); /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ const decoderOpts = { ignoreCodeSection: true, ignoreDataSection: true, // this will avoid having to lookup with identifiers in the ModuleContext ignoreCustomNameSection: true }; class WebAssemblyParser extends Parser { constructor(options) { super(); this.hooks = Object.freeze({}); this.options = options; } /** * @param {string | Buffer | PreparsedAst} source the source to parse * @param {ParserState} state the parser state * @returns {ParserState} the parser state */ parse(source, state) { if (!Buffer.isBuffer(source)) { throw new Error("WebAssemblyParser input must be a Buffer"); } // flag it as async module state.module.buildInfo.strict = true; state.module.buildMeta.exportsType = "namespace"; state.module.buildMeta.async = true; // parse it const program = decode(source, decoderOpts); const module = program.body[0]; const exports = []; t.traverse(module, { ModuleExport({ node }) { exports.push(node.name); }, ModuleImport({ node }) { const dep = new WebAssemblyImportDependency( node.module, node.name, node.descr, false ); state.module.addDependency(dep); } }); state.module.addDependency(new StaticExportsDependency(exports, false)); return state; } } module.exports = WebAssemblyParser; /***/ }), /***/ 13475: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const WebpackError = __webpack_require__(68422); module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { /** @param {string} message Error message */ constructor(message) { super(message); this.name = "UnsupportedWebAssemblyFeatureError"; this.hideStack = true; } }; /***/ }), /***/ 92153: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); const { compareModulesByIdentifier } = __webpack_require__(26296); const WebAssemblyUtils = __webpack_require__(41520); /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ // TODO webpack 6 remove the whole folder // Get all wasm modules const getAllWasmModules = (moduleGraph, chunkGraph, chunk) => { const wasmModules = chunk.getAllAsyncChunks(); const array = []; for (const chunk of wasmModules) { for (const m of chunkGraph.getOrderedChunkModulesIterable( chunk, compareModulesByIdentifier )) { if (m.type.startsWith("webassembly")) { array.push(m); } } } return array; }; /** * generates the import object function for a module * @param {ChunkGraph} chunkGraph the chunk graph * @param {Module} module the module * @param {boolean} mangle mangle imports * @param {string[]} declarations array where declarations are pushed to * @param {RuntimeSpec} runtime the runtime * @returns {string} source code */ const generateImportObject = ( chunkGraph, module, mangle, declarations, runtime ) => { const moduleGraph = chunkGraph.moduleGraph; const waitForInstances = new Map(); const properties = []; const usedWasmDependencies = WebAssemblyUtils.getUsedDependencies( moduleGraph, module, mangle ); for (const usedDep of usedWasmDependencies) { const dep = usedDep.dependency; const importedModule = moduleGraph.getModule(dep); const exportName = dep.name; const usedName = importedModule && moduleGraph .getExportsInfo(importedModule) .getUsedName(exportName, runtime); const description = dep.description; const direct = dep.onlyDirectImport; const module = usedDep.module; const name = usedDep.name; if (direct) { const instanceVar = `m${waitForInstances.size}`; waitForInstances.set(instanceVar, chunkGraph.getModuleId(importedModule)); properties.push({ module, name, value: `${instanceVar}[${JSON.stringify(usedName)}]` }); } else { const params = description.signature.params.map( (param, k) => "p" + k + param.valtype ); const mod = `${RuntimeGlobals.moduleCache}[${JSON.stringify( chunkGraph.getModuleId(importedModule) )}]`; const modExports = `${mod}.exports`; const cache = `wasmImportedFuncCache${declarations.length}`; declarations.push(`var ${cache};`); properties.push({ module, name, value: Template.asString([ (importedModule.type.startsWith("webassembly") ? `${mod} ? ${modExports}[${JSON.stringify(usedName)}] : ` : "") + `function(${params}) {`, Template.indent([ `if(${cache} === undefined) ${cache} = ${modExports};`, `return ${cache}[${JSON.stringify(usedName)}](${params});` ]), "}" ]) }); } } let importObject; if (mangle) { importObject = [ "return {", Template.indent([ properties.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") ]), "};" ]; } else { const propertiesByModule = new Map(); for (const p of properties) { let list = propertiesByModule.get(p.module); if (list === undefined) { propertiesByModule.set(p.module, (list = [])); } list.push(p); } importObject = [ "return {", Template.indent([ Array.from(propertiesByModule, ([module, list]) => { return Template.asString([ `${JSON.stringify(module)}: {`, Template.indent([ list.map(p => `${JSON.stringify(p.name)}: ${p.value}`).join(",\n") ]), "}" ]); }).join(",\n") ]), "};" ]; } const moduleIdStringified = JSON.stringify(chunkGraph.getModuleId(module)); if (waitForInstances.size === 1) { const moduleId = Array.from(waitForInstances.values())[0]; const promise = `installedWasmModules[${JSON.stringify(moduleId)}]`; const variable = Array.from(waitForInstances.keys())[0]; return Template.asString([ `${moduleIdStringified}: function() {`, Template.indent([ `return promiseResolve().then(function() { return ${promise}; }).then(function(${variable}) {`, Template.indent(importObject), "});" ]), "}," ]); } else if (waitForInstances.size > 0) { const promises = Array.from( waitForInstances.values(), id => `installedWasmModules[${JSON.stringify(id)}]` ).join(", "); const variables = Array.from( waitForInstances.keys(), (name, i) => `${name} = array[${i}]` ).join(", "); return Template.asString([ `${moduleIdStringified}: function() {`, Template.indent([ `return promiseResolve().then(function() { return Promise.all([${promises}]); }).then(function(array) {`, Template.indent([`var ${variables};`, ...importObject]), "});" ]), "}," ]); } else { return Template.asString([ `${moduleIdStringified}: function() {`, Template.indent(importObject), "}," ]); } }; class WasmChunkLoadingRuntimeModule extends RuntimeModule { constructor({ generateLoadBinaryCode, supportsStreaming, mangleImports, runtimeRequirements }) { super("wasm chunk loading", RuntimeModule.STAGE_ATTACH); this.generateLoadBinaryCode = generateLoadBinaryCode; this.supportsStreaming = supportsStreaming; this.mangleImports = mangleImports; this._runtimeRequirements = runtimeRequirements; } /** * @returns {string} runtime code */ generate() { const { chunkGraph, compilation, chunk, mangleImports } = this; const { moduleGraph, outputOptions } = compilation; const fn = RuntimeGlobals.ensureChunkHandlers; const withHmr = this._runtimeRequirements.has( RuntimeGlobals.hmrDownloadUpdateHandlers ); const wasmModules = getAllWasmModules(moduleGraph, chunkGraph, chunk); const declarations = []; const importObjects = wasmModules.map(module => { return generateImportObject( chunkGraph, module, this.mangleImports, declarations, chunk.runtime ); }); const chunkModuleIdMap = chunkGraph.getChunkModuleIdMap(chunk, m => m.type.startsWith("webassembly") ); const createImportObject = content => mangleImports ? `{ ${JSON.stringify(WebAssemblyUtils.MANGLED_MODULE)}: ${content} }` : content; const wasmModuleSrcPath = compilation.getPath( JSON.stringify(outputOptions.webassemblyModuleFilename), { hash: `" + ${RuntimeGlobals.getFullHash}() + "`, hashWithLength: length => `" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`, module: { id: '" + wasmModuleId + "', hash: `" + ${JSON.stringify( chunkGraph.getChunkModuleRenderedHashMap(chunk, m => m.type.startsWith("webassembly") ) )}[chunkId][wasmModuleId] + "`, hashWithLength(length) { return `" + ${JSON.stringify( chunkGraph.getChunkModuleRenderedHashMap( chunk, m => m.type.startsWith("webassembly"), length ) )}[chunkId][wasmModuleId] + "`; } }, runtime: chunk.runtime } ); const stateExpression = withHmr ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_wasm` : undefined; return Template.asString([ "// object to store loaded and loading wasm modules", `var installedWasmModules = ${ stateExpression ? `${stateExpression} = ${stateExpression} || ` : "" }{};`, "", // This function is used to delay reading the installed wasm module promises // by a microtask. Sorting them doesn't help because there are edge cases where // sorting is not possible (modules splitted into different chunks). // So we not even trying and solve this by a microtask delay. "function promiseResolve() { return Promise.resolve(); }", "", Template.asString(declarations), "var wasmImportObjects = {", Template.indent(importObjects), "};", "", `var wasmModuleMap = ${JSON.stringify( chunkModuleIdMap, undefined, "\t" )};`, "", "// object with all WebAssembly.instance exports", `${RuntimeGlobals.wasmInstances} = {};`, "", "// Fetch + compile chunk loading for webassembly", `${fn}.wasm = function(chunkId, promises) {`, Template.indent([ "", `var wasmModules = wasmModuleMap[chunkId] || [];`, "", "wasmModules.forEach(function(wasmModuleId, idx) {", Template.indent([ "var installedWasmModuleData = installedWasmModules[wasmModuleId];", "", '// a Promise means "currently loading" or "already loaded".', "if(installedWasmModuleData)", Template.indent(["promises.push(installedWasmModuleData);"]), "else {", Template.indent([ `var importObject = wasmImportObjects[wasmModuleId]();`, `var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`, "var promise;", this.supportsStreaming ? Template.asString([ "if(importObject && typeof importObject.then === 'function' && typeof WebAssembly.compileStreaming === 'function') {", Template.indent([ "promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {", Template.indent([ `return WebAssembly.instantiate(items[0], ${createImportObject( "items[1]" )});` ]), "});" ]), "} else if(typeof WebAssembly.instantiateStreaming === 'function') {", Template.indent([ `promise = WebAssembly.instantiateStreaming(req, ${createImportObject( "importObject" )});` ]) ]) : Template.asString([ "if(importObject && typeof importObject.then === 'function') {", Template.indent([ "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", "promise = Promise.all([", Template.indent([ "bytesPromise.then(function(bytes) { return WebAssembly.compile(bytes); }),", "importObject" ]), "]).then(function(items) {", Template.indent([ `return WebAssembly.instantiate(items[0], ${createImportObject( "items[1]" )});` ]), "});" ]) ]), "} else {", Template.indent([ "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", "promise = bytesPromise.then(function(bytes) {", Template.indent([ `return WebAssembly.instantiate(bytes, ${createImportObject( "importObject" )});` ]), "});" ]), "}", "promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {", Template.indent([ `return ${RuntimeGlobals.wasmInstances}[wasmModuleId] = (res.instance || res).exports;` ]), "}));" ]), "}" ]), "});" ]), "};" ]); } } module.exports = WasmChunkLoadingRuntimeModule; /***/ }), /***/ 12995: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const formatLocation = __webpack_require__(57261); const UnsupportedWebAssemblyFeatureError = __webpack_require__(13475); /** @typedef {import("../Compiler")} Compiler */ class WasmFinalizeExportsPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap("WasmFinalizeExportsPlugin", compilation => { compilation.hooks.finishModules.tap( "WasmFinalizeExportsPlugin", modules => { for (const module of modules) { // 1. if a WebAssembly module if (module.type.startsWith("webassembly") === true) { const jsIncompatibleExports = module.buildMeta.jsIncompatibleExports; if (jsIncompatibleExports === undefined) { continue; } for (const connection of compilation.moduleGraph.getIncomingConnections( module )) { // 2. is active and referenced by a non-WebAssembly module if ( connection.isTargetActive(undefined) && connection.originModule.type.startsWith("webassembly") === false ) { const referencedExports = compilation.getDependencyReferencedExports( connection.dependency, undefined ); for (const info of referencedExports) { const names = Array.isArray(info) ? info : info.name; if (names.length === 0) continue; const name = names[0]; if (typeof name === "object") continue; // 3. and uses a func with an incompatible JS signature if ( Object.prototype.hasOwnProperty.call( jsIncompatibleExports, name ) ) { // 4. error const error = new UnsupportedWebAssemblyFeatureError( `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies\n` + `It's used from ${connection.originModule.readableIdentifier( compilation.requestShortener )} at ${formatLocation(connection.dependency.loc)}.` ); error.module = module; compilation.errors.push(error); } } } } } } } ); }); } } module.exports = WasmFinalizeExportsPlugin; /***/ }), /***/ 35303: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { RawSource } = __webpack_require__(96192); const Generator = __webpack_require__(1826); const WebAssemblyUtils = __webpack_require__(41520); const t = __webpack_require__(98688); const { moduleContextFromModuleAST } = __webpack_require__(98688); const { editWithAST, addWithAST } = __webpack_require__(65584); const { decode } = __webpack_require__(8062); const WebAssemblyExportImportedDependency = __webpack_require__(18248); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ /** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */ /** * @typedef {(ArrayBuffer) => ArrayBuffer} ArrayBufferTransform */ /** * @template T * @param {Function[]} fns transforms * @returns {Function} composed transform */ const compose = (...fns) => { return fns.reduce( (prevFn, nextFn) => { return value => nextFn(prevFn(value)); }, value => value ); }; /** * Removes the start instruction * * @param {Object} state unused state * @returns {ArrayBufferTransform} transform */ const removeStartFunc = state => bin => { return editWithAST(state.ast, bin, { Start(path) { path.remove(); } }); }; /** * Get imported globals * * @param {Object} ast Module's AST * @returns {Array} - nodes */ const getImportedGlobals = ast => { const importedGlobals = []; t.traverse(ast, { ModuleImport({ node }) { if (t.isGlobalType(node.descr)) { importedGlobals.push(node); } } }); return importedGlobals; }; /** * Get the count for imported func * * @param {Object} ast Module's AST * @returns {Number} - count */ const getCountImportedFunc = ast => { let count = 0; t.traverse(ast, { ModuleImport({ node }) { if (t.isFuncImportDescr(node.descr)) { count++; } } }); return count; }; /** * Get next type index * * @param {Object} ast Module's AST * @returns {t.Index} - index */ const getNextTypeIndex = ast => { const typeSectionMetadata = t.getSectionMetadata(ast, "type"); if (typeSectionMetadata === undefined) { return t.indexLiteral(0); } return t.indexLiteral(typeSectionMetadata.vectorOfSize.value); }; /** * Get next func index * * The Func section metadata provide informations for implemented funcs * in order to have the correct index we shift the index by number of external * functions. * * @param {Object} ast Module's AST * @param {Number} countImportedFunc number of imported funcs * @returns {t.Index} - index */ const getNextFuncIndex = (ast, countImportedFunc) => { const funcSectionMetadata = t.getSectionMetadata(ast, "func"); if (funcSectionMetadata === undefined) { return t.indexLiteral(0 + countImportedFunc); } const vectorOfSize = funcSectionMetadata.vectorOfSize.value; return t.indexLiteral(vectorOfSize + countImportedFunc); }; /** * Creates an init instruction for a global type * @param {t.GlobalType} globalType the global type * @returns {t.Instruction} init expression */ const createDefaultInitForGlobal = globalType => { if (globalType.valtype[0] === "i") { // create NumberLiteral global initializer return t.objectInstruction("const", globalType.valtype, [ t.numberLiteralFromRaw(66) ]); } else if (globalType.valtype[0] === "f") { // create FloatLiteral global initializer return t.objectInstruction("const", globalType.valtype, [ t.floatLiteral(66, false, false, "66") ]); } else { throw new Error("unknown type: " + globalType.valtype); } }; /** * Rewrite the import globals: * - removes the ModuleImport instruction * - injects at the same offset a mutable global of the same type * * Since the imported globals are before the other global declarations, our * indices will be preserved. * * Note that globals will become mutable. * * @param {Object} state unused state * @returns {ArrayBufferTransform} transform */ const rewriteImportedGlobals = state => bin => { const additionalInitCode = state.additionalInitCode; const newGlobals = []; bin = editWithAST(state.ast, bin, { ModuleImport(path) { if (t.isGlobalType(path.node.descr)) { const globalType = path.node.descr; globalType.mutability = "var"; const init = [ createDefaultInitForGlobal(globalType), t.instruction("end") ]; newGlobals.push(t.global(globalType, init)); path.remove(); } }, // in order to preserve non-imported global's order we need to re-inject // those as well Global(path) { const { node } = path; const [init] = node.init; if (init.id === "get_global") { node.globalType.mutability = "var"; const initialGlobalIdx = init.args[0]; node.init = [ createDefaultInitForGlobal(node.globalType), t.instruction("end") ]; additionalInitCode.push( /** * get_global in global initializer only works for imported globals. * They have the same indices as the init params, so use the * same index. */ t.instruction("get_local", [initialGlobalIdx]), t.instruction("set_global", [t.indexLiteral(newGlobals.length)]) ); } newGlobals.push(node); path.remove(); } }); // Add global declaration instructions return addWithAST(state.ast, bin, newGlobals); }; /** * Rewrite the export names * @param {Object} state state * @param {Object} state.ast Module's ast * @param {Module} state.module Module * @param {ModuleGraph} state.moduleGraph module graph * @param {Set} state.externalExports Module * @param {RuntimeSpec} state.runtime runtime * @returns {ArrayBufferTransform} transform */ const rewriteExportNames = ({ ast, moduleGraph, module, externalExports, runtime }) => bin => { return editWithAST(ast, bin, { ModuleExport(path) { const isExternal = externalExports.has(path.node.name); if (isExternal) { path.remove(); return; } const usedName = moduleGraph .getExportsInfo(module) .getUsedName(path.node.name, runtime); if (!usedName) { path.remove(); return; } path.node.name = usedName; } }); }; /** * Mangle import names and modules * @param {Object} state state * @param {Object} state.ast Module's ast * @param {Map} state.usedDependencyMap mappings to mangle names * @returns {ArrayBufferTransform} transform */ const rewriteImports = ({ ast, usedDependencyMap }) => bin => { return editWithAST(ast, bin, { ModuleImport(path) { const result = usedDependencyMap.get( path.node.module + ":" + path.node.name ); if (result !== undefined) { path.node.module = result.module; path.node.name = result.name; } } }); }; /** * Add an init function. * * The init function fills the globals given input arguments. * * @param {Object} state transformation state * @param {Object} state.ast Module's ast * @param {t.Identifier} state.initFuncId identifier of the init function * @param {t.Index} state.startAtFuncOffset index of the start function * @param {t.ModuleImport[]} state.importedGlobals list of imported globals * @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function * @param {t.Index} state.nextFuncIndex index of the next function * @param {t.Index} state.nextTypeIndex index of the next type * @returns {ArrayBufferTransform} transform */ const addInitFunction = ({ ast, initFuncId, startAtFuncOffset, importedGlobals, additionalInitCode, nextFuncIndex, nextTypeIndex }) => bin => { const funcParams = importedGlobals.map(importedGlobal => { // used for debugging const id = t.identifier( `${importedGlobal.module}.${importedGlobal.name}` ); return t.funcParam(importedGlobal.descr.valtype, id); }); const funcBody = []; importedGlobals.forEach((importedGlobal, index) => { const args = [t.indexLiteral(index)]; const body = [ t.instruction("get_local", args), t.instruction("set_global", args) ]; funcBody.push(...body); }); if (typeof startAtFuncOffset === "number") { funcBody.push( t.callInstruction(t.numberLiteralFromRaw(startAtFuncOffset)) ); } for (const instr of additionalInitCode) { funcBody.push(instr); } funcBody.push(t.instruction("end")); const funcResults = []; // Code section const funcSignature = t.signature(funcParams, funcResults); const func = t.func(initFuncId, funcSignature, funcBody); // Type section const functype = t.typeInstruction(undefined, funcSignature); // Func section const funcindex = t.indexInFuncSection(nextTypeIndex); // Export section const moduleExport = t.moduleExport( initFuncId.value, t.moduleExportDescr("Func", nextFuncIndex) ); return addWithAST(ast, bin, [func, moduleExport, funcindex, functype]); }; /** * Extract mangle mappings from module * @param {ModuleGraph} moduleGraph module graph * @param {Module} module current module * @param {boolean} mangle mangle imports * @returns {Map} mappings to mangled names */ const getUsedDependencyMap = (moduleGraph, module, mangle) => { /** @type {Map} */ const map = new Map(); for (const usedDep of WebAssemblyUtils.getUsedDependencies( moduleGraph, module, mangle )) { const dep = usedDep.dependency; const request = dep.request; const exportName = dep.name; map.set(request + ":" + exportName, usedDep); } return map; }; const TYPES = new Set(["webassembly"]); class WebAssemblyGenerator extends Generator { constructor(options) { super(); this.options = options; } /** * @param {NormalModule} module fresh module * @returns {Set} available types (do not mutate) */ getTypes(module) { return TYPES; } /** * @param {NormalModule} module the module * @param {string=} type source type * @returns {number} estimate size of the module */ getSize(module, type) { const originalSource = module.originalSource(); if (!originalSource) { return 0; } return originalSource.size(); } /** * @param {NormalModule} module module for which the code should be generated * @param {GenerateContext} generateContext context for generate * @returns {Source} generated code */ generate(module, { moduleGraph, runtime }) { const bin = module.originalSource().source(); const initFuncId = t.identifier(""); // parse it const ast = decode(bin, { ignoreDataSection: true, ignoreCodeSection: true, ignoreCustomNameSection: true }); const moduleContext = moduleContextFromModuleAST(ast.body[0]); const importedGlobals = getImportedGlobals(ast); const countImportedFunc = getCountImportedFunc(ast); const startAtFuncOffset = moduleContext.getStart(); const nextFuncIndex = getNextFuncIndex(ast, countImportedFunc); const nextTypeIndex = getNextTypeIndex(ast); const usedDependencyMap = getUsedDependencyMap( moduleGraph, module, this.options.mangleImports ); const externalExports = new Set( module.dependencies .filter(d => d instanceof WebAssemblyExportImportedDependency) .map(d => { const wasmDep = /** @type {WebAssemblyExportImportedDependency} */ ( d ); return wasmDep.exportName; }) ); /** @type {t.Instruction[]} */ const additionalInitCode = []; const transform = compose( rewriteExportNames({ ast, moduleGraph, module, externalExports, runtime }), removeStartFunc({ ast }), rewriteImportedGlobals({ ast, additionalInitCode }), rewriteImports({ ast, usedDependencyMap }), addInitFunction({ ast, initFuncId, importedGlobals, additionalInitCode, startAtFuncOffset, nextFuncIndex, nextTypeIndex }) ); const newBin = transform(bin); const newBuf = Buffer.from(newBin); return new RawSource(newBuf); } } module.exports = WebAssemblyGenerator; /***/ }), /***/ 14073: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const WebpackError = __webpack_require__(68422); /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../RequestShortener")} RequestShortener */ /** * @param {Module} module module to get chains from * @param {ModuleGraph} moduleGraph the module graph * @param {ChunkGraph} chunkGraph the chunk graph * @param {RequestShortener} requestShortener to make readable identifiers * @returns {string[]} all chains to the module */ const getInitialModuleChains = ( module, moduleGraph, chunkGraph, requestShortener ) => { const queue = [ { head: module, message: module.readableIdentifier(requestShortener) } ]; /** @type {Set} */ const results = new Set(); /** @type {Set} */ const incompleteResults = new Set(); /** @type {Set} */ const visitedModules = new Set(); for (const chain of queue) { const { head, message } = chain; let final = true; /** @type {Set} */ const alreadyReferencedModules = new Set(); for (const connection of moduleGraph.getIncomingConnections(head)) { const newHead = connection.originModule; if (newHead) { if (!chunkGraph.getModuleChunks(newHead).some(c => c.canBeInitial())) continue; final = false; if (alreadyReferencedModules.has(newHead)) continue; alreadyReferencedModules.add(newHead); const moduleName = newHead.readableIdentifier(requestShortener); const detail = connection.explanation ? ` (${connection.explanation})` : ""; const newMessage = `${moduleName}${detail} --> ${message}`; if (visitedModules.has(newHead)) { incompleteResults.add(`... --> ${newMessage}`); continue; } visitedModules.add(newHead); queue.push({ head: newHead, message: newMessage }); } else { final = false; const newMessage = connection.explanation ? `(${connection.explanation}) --> ${message}` : message; results.add(newMessage); } } if (final) { results.add(message); } } for (const result of incompleteResults) { results.add(result); } return Array.from(results); }; module.exports = class WebAssemblyInInitialChunkError extends WebpackError { /** * @param {Module} module WASM module * @param {ModuleGraph} moduleGraph the module graph * @param {ChunkGraph} chunkGraph the chunk graph * @param {RequestShortener} requestShortener request shortener */ constructor(module, moduleGraph, chunkGraph, requestShortener) { const moduleChains = getInitialModuleChains( module, moduleGraph, chunkGraph, requestShortener ); const message = `WebAssembly module is included in initial chunk. This is not allowed, because WebAssembly download and compilation must happen asynchronous. Add an async split point (i. e. import()) somewhere between your entrypoint and the WebAssembly module: ${moduleChains.map(s => `* ${s}`).join("\n")}`; super(message); this.name = "WebAssemblyInInitialChunkError"; this.hideStack = true; this.module = module; } }; /***/ }), /***/ 88890: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { RawSource } = __webpack_require__(96192); const { UsageState } = __webpack_require__(4295); const Generator = __webpack_require__(1826); const InitFragment = __webpack_require__(51739); const RuntimeGlobals = __webpack_require__(49404); const Template = __webpack_require__(92066); const ModuleDependency = __webpack_require__(80944); const WebAssemblyExportImportedDependency = __webpack_require__(18248); const WebAssemblyImportDependency = __webpack_require__(97093); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ const TYPES = new Set(["webassembly"]); class WebAssemblyJavascriptGenerator extends Generator { /** * @param {NormalModule} module fresh module * @returns {Set} available types (do not mutate) */ getTypes(module) { return TYPES; } /** * @param {NormalModule} module the module * @param {string=} type source type * @returns {number} estimate size of the module */ getSize(module, type) { return 95 + module.dependencies.length * 5; } /** * @param {NormalModule} module module for which the code should be generated * @param {GenerateContext} generateContext context for generate * @returns {Source} generated code */ generate(module, generateContext) { const { runtimeTemplate, moduleGraph, chunkGraph, runtimeRequirements, runtime } = generateContext; /** @type {InitFragment[]} */ const initFragments = []; const exportsInfo = moduleGraph.getExportsInfo(module); let needExportsCopy = false; const importedModules = new Map(); const initParams = []; let index = 0; for (const dep of module.dependencies) { const moduleDep = dep && dep instanceof ModuleDependency ? dep : undefined; if (moduleGraph.getModule(dep)) { let importData = importedModules.get(moduleGraph.getModule(dep)); if (importData === undefined) { importedModules.set( moduleGraph.getModule(dep), (importData = { importVar: `m${index}`, index, request: (moduleDep && moduleDep.userRequest) || undefined, names: new Set(), reexports: [] }) ); index++; } if (dep instanceof WebAssemblyImportDependency) { importData.names.add(dep.name); if (dep.description.type === "GlobalType") { const exportName = dep.name; const importedModule = moduleGraph.getModule(dep); if (importedModule) { const usedName = moduleGraph .getExportsInfo(importedModule) .getUsedName(exportName, runtime); if (usedName) { initParams.push( runtimeTemplate.exportFromImport({ moduleGraph, module: importedModule, request: dep.request, importVar: importData.importVar, originModule: module, exportName: dep.name, asiSafe: true, isCall: false, callContext: null, defaultInterop: true, initFragments, runtime, runtimeRequirements }) ); } } } } if (dep instanceof WebAssemblyExportImportedDependency) { importData.names.add(dep.name); const usedName = moduleGraph .getExportsInfo(module) .getUsedName(dep.exportName, runtime); if (usedName) { runtimeRequirements.add(RuntimeGlobals.exports); const exportProp = `${module.exportsArgument}[${JSON.stringify( usedName )}]`; const defineStatement = Template.asString([ `${exportProp} = ${runtimeTemplate.exportFromImport({ moduleGraph, module: moduleGraph.getModule(dep), request: dep.request, importVar: importData.importVar, originModule: module, exportName: dep.name, asiSafe: true, isCall: false, callContext: null, defaultInterop: true, initFragments, runtime, runtimeRequirements })};`, `if(WebAssembly.Global) ${exportProp} = ` + `new WebAssembly.Global({ value: ${JSON.stringify( dep.valueType )} }, ${exportProp});` ]); importData.reexports.push(defineStatement); needExportsCopy = true; } } } } const importsCode = Template.asString( Array.from( importedModules, ([module, { importVar, request, reexports }]) => { const importStatement = runtimeTemplate.importStatement({ module, chunkGraph, request, importVar, originModule: module, runtimeRequirements }); return importStatement[0] + importStatement[1] + reexports.join("\n"); } ) ); const copyAllExports = exportsInfo.otherExportsInfo.getUsed(runtime) === UsageState.Unused && !needExportsCopy; // need these globals runtimeRequirements.add(RuntimeGlobals.module); runtimeRequirements.add(RuntimeGlobals.moduleId); runtimeRequirements.add(RuntimeGlobals.wasmInstances); if (exportsInfo.otherExportsInfo.getUsed(runtime) !== UsageState.Unused) { runtimeRequirements.add(RuntimeGlobals.makeNamespaceObject); runtimeRequirements.add(RuntimeGlobals.exports); } if (!copyAllExports) { runtimeRequirements.add(RuntimeGlobals.exports); } // create source const source = new RawSource( [ '"use strict";', "// Instantiate WebAssembly module", `var wasmExports = ${RuntimeGlobals.wasmInstances}[${module.moduleArgument}.id];`, exportsInfo.otherExportsInfo.getUsed(runtime) !== UsageState.Unused ? `${RuntimeGlobals.makeNamespaceObject}(${module.exportsArgument});` : "", // this must be before import for circular dependencies "// export exports from WebAssembly module", copyAllExports ? `${module.moduleArgument}.exports = wasmExports;` : "for(var name in wasmExports) " + `if(name) ` + `${module.exportsArgument}[name] = wasmExports[name];`, "// exec imports from WebAssembly module (for esm order)", importsCode, "", "// exec wasm module", `wasmExports[""](${initParams.join(", ")})` ].join("\n") ); return InitFragment.addToSource(source, initFragments, generateContext); } } module.exports = WebAssemblyJavascriptGenerator; /***/ }), /***/ 93813: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Generator = __webpack_require__(1826); const WebAssemblyExportImportedDependency = __webpack_require__(18248); const WebAssemblyImportDependency = __webpack_require__(97093); const { compareModulesByIdentifier } = __webpack_require__(26296); const memoize = __webpack_require__(84297); const WebAssemblyInInitialChunkError = __webpack_require__(14073); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleTemplate")} ModuleTemplate */ /** @typedef {import("../javascript/JavascriptModulesPlugin").RenderContext} RenderContext */ const getWebAssemblyGenerator = memoize(() => __webpack_require__(35303) ); const getWebAssemblyJavascriptGenerator = memoize(() => __webpack_require__(88890) ); const getWebAssemblyParser = memoize(() => __webpack_require__(52288)); class WebAssemblyModulesPlugin { constructor(options) { this.options = options; } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap( "WebAssemblyModulesPlugin", (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( WebAssemblyImportDependency, normalModuleFactory ); compilation.dependencyFactories.set( WebAssemblyExportImportedDependency, normalModuleFactory ); normalModuleFactory.hooks.createParser .for("webassembly/sync") .tap("WebAssemblyModulesPlugin", () => { const WebAssemblyParser = getWebAssemblyParser(); return new WebAssemblyParser(); }); normalModuleFactory.hooks.createGenerator .for("webassembly/sync") .tap("WebAssemblyModulesPlugin", () => { const WebAssemblyJavascriptGenerator = getWebAssemblyJavascriptGenerator(); const WebAssemblyGenerator = getWebAssemblyGenerator(); return Generator.byType({ javascript: new WebAssemblyJavascriptGenerator(), webassembly: new WebAssemblyGenerator(this.options) }); }); compilation.hooks.renderManifest.tap( "WebAssemblyModulesPlugin", (result, options) => { const { chunkGraph } = compilation; const { chunk, outputOptions, codeGenerationResults } = options; for (const module of chunkGraph.getOrderedChunkModulesIterable( chunk, compareModulesByIdentifier )) { if (module.type === "webassembly/sync") { const filenameTemplate = outputOptions.webassemblyModuleFilename; result.push({ render: () => codeGenerationResults.getSource( module, chunk.runtime, "webassembly" ), filenameTemplate, pathOptions: { module, runtime: chunk.runtime, chunkGraph }, auxiliary: true, identifier: `webassemblyModule${chunkGraph.getModuleId( module )}`, hash: chunkGraph.getModuleHash(module, chunk.runtime) }); } } return result; } ); compilation.hooks.afterChunks.tap("WebAssemblyModulesPlugin", () => { const chunkGraph = compilation.chunkGraph; const initialWasmModules = new Set(); for (const chunk of compilation.chunks) { if (chunk.canBeInitial()) { for (const module of chunkGraph.getChunkModulesIterable(chunk)) { if (module.type === "webassembly/sync") { initialWasmModules.add(module); } } } } for (const module of initialWasmModules) { compilation.errors.push( new WebAssemblyInInitialChunkError( module, compilation.moduleGraph, compilation.chunkGraph, compilation.requestShortener ) ); } }); } ); } } module.exports = WebAssemblyModulesPlugin; /***/ }), /***/ 52288: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const t = __webpack_require__(98688); const { moduleContextFromModuleAST } = __webpack_require__(98688); const { decode } = __webpack_require__(8062); const Parser = __webpack_require__(68214); const StaticExportsDependency = __webpack_require__(67967); const WebAssemblyExportImportedDependency = __webpack_require__(18248); const WebAssemblyImportDependency = __webpack_require__(97093); /** @typedef {import("../Module")} Module */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ const JS_COMPAT_TYPES = new Set(["i32", "f32", "f64"]); /** * @param {t.Signature} signature the func signature * @returns {null | string} the type incompatible with js types */ const getJsIncompatibleType = signature => { for (const param of signature.params) { if (!JS_COMPAT_TYPES.has(param.valtype)) { return `${param.valtype} as parameter`; } } for (const type of signature.results) { if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; } return null; }; /** * TODO why are there two different Signature types? * @param {t.FuncSignature} signature the func signature * @returns {null | string} the type incompatible with js types */ const getJsIncompatibleTypeOfFuncSignature = signature => { for (const param of signature.args) { if (!JS_COMPAT_TYPES.has(param)) { return `${param} as parameter`; } } for (const type of signature.result) { if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`; } return null; }; const decoderOpts = { ignoreCodeSection: true, ignoreDataSection: true, // this will avoid having to lookup with identifiers in the ModuleContext ignoreCustomNameSection: true }; class WebAssemblyParser extends Parser { constructor(options) { super(); this.hooks = Object.freeze({}); this.options = options; } /** * @param {string | Buffer | PreparsedAst} source the source to parse * @param {ParserState} state the parser state * @returns {ParserState} the parser state */ parse(source, state) { if (!Buffer.isBuffer(source)) { throw new Error("WebAssemblyParser input must be a Buffer"); } // flag it as ESM state.module.buildInfo.strict = true; state.module.buildMeta.exportsType = "namespace"; // parse it const program = decode(source, decoderOpts); const module = program.body[0]; const moduleContext = moduleContextFromModuleAST(module); // extract imports and exports const exports = []; let jsIncompatibleExports = (state.module.buildMeta.jsIncompatibleExports = undefined); const importedGlobals = []; t.traverse(module, { ModuleExport({ node }) { const descriptor = node.descr; if (descriptor.exportType === "Func") { const funcIdx = descriptor.id.value; /** @type {t.FuncSignature} */ const funcSignature = moduleContext.getFunction(funcIdx); const incompatibleType = getJsIncompatibleTypeOfFuncSignature(funcSignature); if (incompatibleType) { if (jsIncompatibleExports === undefined) { jsIncompatibleExports = state.module.buildMeta.jsIncompatibleExports = {}; } jsIncompatibleExports[node.name] = incompatibleType; } } exports.push(node.name); if (node.descr && node.descr.exportType === "Global") { const refNode = importedGlobals[node.descr.id.value]; if (refNode) { const dep = new WebAssemblyExportImportedDependency( node.name, refNode.module, refNode.name, refNode.descr.valtype ); state.module.addDependency(dep); } } }, Global({ node }) { const init = node.init[0]; let importNode = null; if (init.id === "get_global") { const globalIdx = init.args[0].value; if (globalIdx < importedGlobals.length) { importNode = importedGlobals[globalIdx]; } } importedGlobals.push(importNode); }, ModuleImport({ node }) { /** @type {false | string} */ let onlyDirectImport = false; if (t.isMemory(node.descr) === true) { onlyDirectImport = "Memory"; } else if (t.isTable(node.descr) === true) { onlyDirectImport = "Table"; } else if (t.isFuncImportDescr(node.descr) === true) { const incompatibleType = getJsIncompatibleType(node.descr.signature); if (incompatibleType) { onlyDirectImport = `Non-JS-compatible Func Signature (${incompatibleType})`; } } else if (t.isGlobalType(node.descr) === true) { const type = node.descr.valtype; if (!JS_COMPAT_TYPES.has(type)) { onlyDirectImport = `Non-JS-compatible Global Type (${type})`; } } const dep = new WebAssemblyImportDependency( node.module, node.name, node.descr, onlyDirectImport ); state.module.addDependency(dep); if (t.isGlobalType(node.descr)) { importedGlobals.push(node); } } }); state.module.addDependency(new StaticExportsDependency(exports, false)); return state; } } module.exports = WebAssemblyParser; /***/ }), /***/ 41520: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Template = __webpack_require__(92066); const WebAssemblyImportDependency = __webpack_require__(97093); /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {Object} UsedWasmDependency * @property {WebAssemblyImportDependency} dependency the dependency * @property {string} name the export name * @property {string} module the module name */ const MANGLED_MODULE = "a"; /** * @param {ModuleGraph} moduleGraph the module graph * @param {Module} module the module * @param {boolean} mangle mangle module and export names * @returns {UsedWasmDependency[]} used dependencies and (mangled) name */ const getUsedDependencies = (moduleGraph, module, mangle) => { /** @type {UsedWasmDependency[]} */ const array = []; let importIndex = 0; for (const dep of module.dependencies) { if (dep instanceof WebAssemblyImportDependency) { if ( dep.description.type === "GlobalType" || moduleGraph.getModule(dep) === null ) { continue; } const exportName = dep.name; // TODO add the following 3 lines when removing of ModuleExport is possible // const importedModule = moduleGraph.getModule(dep); // const usedName = importedModule && moduleGraph.getExportsInfo(importedModule).getUsedName(exportName, runtime); // if (usedName !== false) { if (mangle) { array.push({ dependency: dep, name: Template.numberToIdentifier(importIndex++), module: MANGLED_MODULE }); } else { array.push({ dependency: dep, name: exportName, module: dep.request }); } } } return array; }; exports.getUsedDependencies = getUsedDependencies; exports.MANGLED_MODULE = MANGLED_MODULE; /***/ }), /***/ 93943: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ /** @typedef {import("../../declarations/WebpackOptions").WasmLoadingType} WasmLoadingType */ /** @typedef {import("../Compiler")} Compiler */ /** @type {WeakMap>} */ const enabledTypes = new WeakMap(); const getEnabledTypes = compiler => { let set = enabledTypes.get(compiler); if (set === undefined) { set = new Set(); enabledTypes.set(compiler, set); } return set; }; class EnableWasmLoadingPlugin { /** * @param {WasmLoadingType} type library type that should be available */ constructor(type) { this.type = type; } /** * @param {Compiler} compiler the compiler instance * @param {WasmLoadingType} type type of library * @returns {void} */ static setEnabled(compiler, type) { getEnabledTypes(compiler).add(type); } /** * @param {Compiler} compiler the compiler instance * @param {WasmLoadingType} type type of library * @returns {void} */ static checkEnabled(compiler, type) { if (!getEnabledTypes(compiler).has(type)) { throw new Error( `Library type "${type}" is not enabled. ` + "EnableWasmLoadingPlugin need to be used to enable this type of wasm loading. " + 'This usually happens through the "output.enabledWasmLoadingTypes" option. ' + 'If you are using a function as entry which sets "wasmLoading", you need to add all potential library types to "output.enabledWasmLoadingTypes". ' + "These types are enabled: " + Array.from(getEnabledTypes(compiler)).join(", ") ); } } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { const { type } = this; // Only enable once const enabled = getEnabledTypes(compiler); if (enabled.has(type)) return; enabled.add(type); if (typeof type === "string") { switch (type) { case "fetch": { // TODO webpack 6 remove FetchCompileWasmPlugin const FetchCompileWasmPlugin = __webpack_require__(89728); const FetchCompileAsyncWasmPlugin = __webpack_require__(37118); new FetchCompileWasmPlugin({ mangleImports: compiler.options.optimization.mangleWasmImports }).apply(compiler); new FetchCompileAsyncWasmPlugin().apply(compiler); break; } case "async-node": { // TODO webpack 6 remove ReadFileCompileWasmPlugin const ReadFileCompileWasmPlugin = __webpack_require__(98724); // @ts-expect-error typescript bug for duplicate require const ReadFileCompileAsyncWasmPlugin = __webpack_require__(82138); new ReadFileCompileWasmPlugin({ mangleImports: compiler.options.optimization.mangleWasmImports }).apply(compiler); new ReadFileCompileAsyncWasmPlugin({ type }).apply(compiler); break; } case "async-node-module": { // @ts-expect-error typescript bug for duplicate require const ReadFileCompileAsyncWasmPlugin = __webpack_require__(82138); new ReadFileCompileAsyncWasmPlugin({ type, import: true }).apply( compiler ); break; } case "universal": throw new Error( "Universal WebAssembly Loading is not implemented yet" ); default: throw new Error(`Unsupported wasm loading type ${type}. Plugins which provide custom wasm loading types must call EnableWasmLoadingPlugin.setEnabled(compiler, type) to disable this error.`); } } else { // TODO support plugin instances here // apply them to the compiler } } } module.exports = EnableWasmLoadingPlugin; /***/ }), /***/ 37118: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const AsyncWasmLoadingRuntimeModule = __webpack_require__(84465); /** @typedef {import("../Compiler")} Compiler */ class FetchCompileAsyncWasmPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.thisCompilation.tap( "FetchCompileAsyncWasmPlugin", compilation => { const globalWasmLoading = compilation.outputOptions.wasmLoading; const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const wasmLoading = options && options.wasmLoading !== undefined ? options.wasmLoading : globalWasmLoading; return wasmLoading === "fetch"; }; const generateLoadBinaryCode = path => `fetch(${RuntimeGlobals.publicPath} + ${path})`; compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.instantiateWasm) .tap("FetchCompileAsyncWasmPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; const chunkGraph = compilation.chunkGraph; if ( !chunkGraph.hasModuleInGraph( chunk, m => m.type === "webassembly/async" ) ) { return; } set.add(RuntimeGlobals.publicPath); compilation.addRuntimeModule( chunk, new AsyncWasmLoadingRuntimeModule({ generateLoadBinaryCode, supportsStreaming: true }) ); }); } ); } } module.exports = FetchCompileAsyncWasmPlugin; /***/ }), /***/ 89728: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const WasmChunkLoadingRuntimeModule = __webpack_require__(92153); /** @typedef {import("../Compiler")} Compiler */ // TODO webpack 6 remove class FetchCompileWasmPlugin { constructor(options) { this.options = options || {}; } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.thisCompilation.tap( "FetchCompileWasmPlugin", compilation => { const globalWasmLoading = compilation.outputOptions.wasmLoading; const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const wasmLoading = options && options.wasmLoading !== undefined ? options.wasmLoading : globalWasmLoading; return wasmLoading === "fetch"; }; const generateLoadBinaryCode = path => `fetch(${RuntimeGlobals.publicPath} + ${path})`; compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.ensureChunkHandlers) .tap("FetchCompileWasmPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; const chunkGraph = compilation.chunkGraph; if ( !chunkGraph.hasModuleInGraph( chunk, m => m.type === "webassembly/sync" ) ) { return; } set.add(RuntimeGlobals.moduleCache); set.add(RuntimeGlobals.publicPath); compilation.addRuntimeModule( chunk, new WasmChunkLoadingRuntimeModule({ generateLoadBinaryCode, supportsStreaming: true, mangleImports: this.options.mangleImports, runtimeRequirements: set }) ); }); } ); } } module.exports = FetchCompileWasmPlugin; /***/ }), /***/ 9253: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const JsonpChunkLoadingRuntimeModule = __webpack_require__(66032); /** @typedef {import("../Compiler")} Compiler */ class JsonpChunkLoadingPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.thisCompilation.tap( "JsonpChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = options && options.chunkLoading !== undefined ? options.chunkLoading : globalChunkLoading; return chunkLoading === "jsonp"; }; const onceForChunkSet = new WeakSet(); const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.moduleFactoriesAddOnly); set.add(RuntimeGlobals.hasOwnProperty); compilation.addRuntimeModule( chunk, new JsonpChunkLoadingRuntimeModule(set) ); }; compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.ensureChunkHandlers) .tap("JsonpChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadUpdateHandlers) .tap("JsonpChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadManifest) .tap("JsonpChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.baseURI) .tap("JsonpChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.onChunksLoaded) .tap("JsonpChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.ensureChunkHandlers) .tap("JsonpChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.loadScript); set.add(RuntimeGlobals.getChunkScriptFilename); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadUpdateHandlers) .tap("JsonpChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.loadScript); set.add(RuntimeGlobals.getChunkUpdateScriptFilename); set.add(RuntimeGlobals.moduleCache); set.add(RuntimeGlobals.hmrModuleData); set.add(RuntimeGlobals.moduleFactoriesAddOnly); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadManifest) .tap("JsonpChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.getUpdateManifestFilename); }); } ); } } module.exports = JsonpChunkLoadingPlugin; /***/ }), /***/ 66032: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const { SyncWaterfallHook } = __webpack_require__(34718); const Compilation = __webpack_require__(59622); const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); const chunkHasJs = __webpack_require__(76767).chunkHasJs; const { getInitialChunkIds } = __webpack_require__(30951); const compileBooleanMatcher = __webpack_require__(356); /** @typedef {import("../Chunk")} Chunk */ /** * @typedef {Object} JsonpCompilationPluginHooks * @property {SyncWaterfallHook<[string, Chunk]>} linkPreload * @property {SyncWaterfallHook<[string, Chunk]>} linkPrefetch */ /** @type {WeakMap} */ const compilationHooksMap = new WeakMap(); class JsonpChunkLoadingRuntimeModule extends RuntimeModule { /** * @param {Compilation} compilation the compilation * @returns {JsonpCompilationPluginHooks} hooks */ static getCompilationHooks(compilation) { if (!(compilation instanceof Compilation)) { throw new TypeError( "The 'compilation' argument must be an instance of Compilation" ); } let hooks = compilationHooksMap.get(compilation); if (hooks === undefined) { hooks = { linkPreload: new SyncWaterfallHook(["source", "chunk"]), linkPrefetch: new SyncWaterfallHook(["source", "chunk"]) }; compilationHooksMap.set(compilation, hooks); } return hooks; } constructor(runtimeRequirements) { super("jsonp chunk loading", RuntimeModule.STAGE_ATTACH); this._runtimeRequirements = runtimeRequirements; } /** * @returns {string} runtime code */ generate() { const { chunkGraph, compilation, chunk } = this; const { runtimeTemplate, outputOptions: { globalObject, chunkLoadingGlobal, hotUpdateGlobal, crossOriginLoading, scriptType } } = compilation; const { linkPreload, linkPrefetch } = JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation); const fn = RuntimeGlobals.ensureChunkHandlers; const withBaseURI = this._runtimeRequirements.has(RuntimeGlobals.baseURI); const withLoading = this._runtimeRequirements.has( RuntimeGlobals.ensureChunkHandlers ); const withCallback = this._runtimeRequirements.has( RuntimeGlobals.chunkCallback ); const withOnChunkLoad = this._runtimeRequirements.has( RuntimeGlobals.onChunksLoaded ); const withHmr = this._runtimeRequirements.has( RuntimeGlobals.hmrDownloadUpdateHandlers ); const withHmrManifest = this._runtimeRequirements.has( RuntimeGlobals.hmrDownloadManifest ); const withPrefetch = this._runtimeRequirements.has( RuntimeGlobals.prefetchChunkHandlers ); const withPreload = this._runtimeRequirements.has( RuntimeGlobals.preloadChunkHandlers ); const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify( chunkLoadingGlobal )}]`; const conditionMap = chunkGraph.getChunkConditionMap(chunk, chunkHasJs); const hasJsMatcher = compileBooleanMatcher(conditionMap); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph); const stateExpression = withHmr ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_jsonp` : undefined; return Template.asString([ withBaseURI ? Template.asString([ `${RuntimeGlobals.baseURI} = document.baseURI || self.location.href;` ]) : "// no baseURI", "", "// object to store loaded and loading chunks", "// undefined = chunk not loaded, null = chunk preloaded/prefetched", "// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded", `var installedChunks = ${ stateExpression ? `${stateExpression} = ${stateExpression} || ` : "" }{`, Template.indent( Array.from(initialChunkIds, id => `${JSON.stringify(id)}: 0`).join( ",\n" ) ), "};", "", withLoading ? Template.asString([ `${fn}.j = ${runtimeTemplate.basicFunction( "chunkId, promises", hasJsMatcher !== false ? Template.indent([ "// JSONP chunk loading for javascript", `var installedChunkData = ${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;`, 'if(installedChunkData !== 0) { // 0 means "already installed".', Template.indent([ "", '// a Promise means "currently loading".', "if(installedChunkData) {", Template.indent([ "promises.push(installedChunkData[2]);" ]), "} else {", Template.indent([ hasJsMatcher === true ? "if(true) { // all chunks have JS" : `if(${hasJsMatcher("chunkId")}) {`, Template.indent([ "// setup Promise in chunk cache", `var promise = new Promise(${runtimeTemplate.expressionFunction( `installedChunkData = installedChunks[chunkId] = [resolve, reject]`, "resolve, reject" )});`, "promises.push(installedChunkData[2] = promise);", "", "// start chunk loading", `var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`, "// create error before stack unwound to get useful stacktrace later", "var error = new Error();", `var loadingEnded = ${runtimeTemplate.basicFunction( "event", [ `if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId)) {`, Template.indent([ "installedChunkData = installedChunks[chunkId];", "if(installedChunkData !== 0) installedChunks[chunkId] = undefined;", "if(installedChunkData) {", Template.indent([ "var errorType = event && (event.type === 'load' ? 'missing' : event.type);", "var realSrc = event && event.target && event.target.src;", "error.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", "error.name = 'ChunkLoadError';", "error.type = errorType;", "error.request = realSrc;", "installedChunkData[1](error);" ]), "}" ]), "}" ] )};`, `${RuntimeGlobals.loadScript}(url, loadingEnded, "chunk-" + chunkId, chunkId);` ]), "} else installedChunks[chunkId] = 0;" ]), "}" ]), "}" ]) : Template.indent(["installedChunks[chunkId] = 0;"]) )};` ]) : "// no chunk on demand loading", "", withPrefetch && hasJsMatcher !== false ? `${ RuntimeGlobals.prefetchChunkHandlers }.j = ${runtimeTemplate.basicFunction("chunkId", [ `if((!${ RuntimeGlobals.hasOwnProperty }(installedChunks, chunkId) || installedChunks[chunkId] === undefined) && ${ hasJsMatcher === true ? "true" : hasJsMatcher("chunkId") }) {`, Template.indent([ "installedChunks[chunkId] = null;", linkPrefetch.call( Template.asString([ "var link = document.createElement('link');", crossOriginLoading ? `link.crossOrigin = ${JSON.stringify( crossOriginLoading )};` : "", `if (${RuntimeGlobals.scriptNonce}) {`, Template.indent( `link.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});` ), "}", 'link.rel = "prefetch";', 'link.as = "script";', `link.href = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);` ]), chunk ), "document.head.appendChild(link);" ]), "}" ])};` : "// no prefetching", "", withPreload && hasJsMatcher !== false ? `${ RuntimeGlobals.preloadChunkHandlers }.j = ${runtimeTemplate.basicFunction("chunkId", [ `if((!${ RuntimeGlobals.hasOwnProperty }(installedChunks, chunkId) || installedChunks[chunkId] === undefined) && ${ hasJsMatcher === true ? "true" : hasJsMatcher("chunkId") }) {`, Template.indent([ "installedChunks[chunkId] = null;", linkPreload.call( Template.asString([ "var link = document.createElement('link');", scriptType ? `link.type = ${JSON.stringify(scriptType)};` : "", "link.charset = 'utf-8';", `if (${RuntimeGlobals.scriptNonce}) {`, Template.indent( `link.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});` ), "}", 'link.rel = "preload";', 'link.as = "script";', `link.href = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`, crossOriginLoading ? Template.asString([ "if (link.href.indexOf(window.location.origin + '/') !== 0) {", Template.indent( `link.crossOrigin = ${JSON.stringify( crossOriginLoading )};` ), "}" ]) : "" ]), chunk ), "document.head.appendChild(link);" ]), "}" ])};` : "// no preloaded", "", withHmr ? Template.asString([ "var currentUpdatedModulesList;", "var waitingUpdateResolves = {};", "function loadUpdateChunk(chunkId) {", Template.indent([ `return new Promise(${runtimeTemplate.basicFunction( "resolve, reject", [ "waitingUpdateResolves[chunkId] = resolve;", "// start update chunk loading", `var url = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId);`, "// create error before stack unwound to get useful stacktrace later", "var error = new Error();", `var loadingEnded = ${runtimeTemplate.basicFunction("event", [ "if(waitingUpdateResolves[chunkId]) {", Template.indent([ "waitingUpdateResolves[chunkId] = undefined", "var errorType = event && (event.type === 'load' ? 'missing' : event.type);", "var realSrc = event && event.target && event.target.src;", "error.message = 'Loading hot update chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", "error.name = 'ChunkLoadError';", "error.type = errorType;", "error.request = realSrc;", "reject(error);" ]), "}" ])};`, `${RuntimeGlobals.loadScript}(url, loadingEnded);` ] )});` ]), "}", "", `${globalObject}[${JSON.stringify( hotUpdateGlobal )}] = ${runtimeTemplate.basicFunction( "chunkId, moreModules, runtime", [ "for(var moduleId in moreModules) {", Template.indent([ `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`, Template.indent([ "currentUpdate[moduleId] = moreModules[moduleId];", "if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);" ]), "}" ]), "}", "if(runtime) currentUpdateRuntime.push(runtime);", "if(waitingUpdateResolves[chunkId]) {", Template.indent([ "waitingUpdateResolves[chunkId]();", "waitingUpdateResolves[chunkId] = undefined;" ]), "}" ] )};`, "", Template.getFunctionContent( require('./JavascriptHotModuleReplacement.runtime.js') ) .replace(/\$key\$/g, "jsonp") .replace(/\$installedChunks\$/g, "installedChunks") .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) .replace( /\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers ) .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) .replace( /\$hmrDownloadUpdateHandlers\$/g, RuntimeGlobals.hmrDownloadUpdateHandlers ) .replace( /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) ]) : "// no HMR", "", withHmrManifest ? Template.asString([ `${ RuntimeGlobals.hmrDownloadManifest } = ${runtimeTemplate.basicFunction("", [ 'if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");', `return fetch(${RuntimeGlobals.publicPath} + ${ RuntimeGlobals.getUpdateManifestFilename }()).then(${runtimeTemplate.basicFunction("response", [ "if(response.status === 404) return; // no update available", 'if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);', "return response.json();" ])});` ])};` ]) : "// no HMR manifest", "", withOnChunkLoad ? `${ RuntimeGlobals.onChunksLoaded }.j = ${runtimeTemplate.returningFunction( "installedChunks[chunkId] === 0", "chunkId" )};` : "// no on chunks loaded", "", withCallback || withLoading ? Template.asString([ "// install a JSONP callback for chunk loading", `var webpackJsonpCallback = ${runtimeTemplate.basicFunction( "parentChunkLoadingFunction, data", [ runtimeTemplate.destructureArray( ["chunkIds", "moreModules", "runtime"], "data" ), '// add "moreModules" to the modules object,', '// then flag all "chunkIds" as loaded and fire callback', "var moduleId, chunkId, i = 0;", `if(chunkIds.some(${runtimeTemplate.returningFunction( "installedChunks[id] !== 0", "id" )})) {`, Template.indent([ "for(moduleId in moreModules) {", Template.indent([ `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`, Template.indent( `${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];` ), "}" ]), "}", "if(runtime) var result = runtime(__webpack_require__);" ]), "}", "if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);", "for(;i < chunkIds.length; i++) {", Template.indent([ "chunkId = chunkIds[i];", `if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) && installedChunks[chunkId]) {`, Template.indent("installedChunks[chunkId][0]();"), "}", "installedChunks[chunkIds[i]] = 0;" ]), "}", withOnChunkLoad ? `return ${RuntimeGlobals.onChunksLoaded}(result);` : "" ] )}`, "", `var chunkLoadingGlobal = ${chunkLoadingGlobalExpr} = ${chunkLoadingGlobalExpr} || [];`, "chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));", "chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));" ]) : "// no jsonp function" ]); } } module.exports = JsonpChunkLoadingRuntimeModule; /***/ }), /***/ 45968: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(86189); const EnableChunkLoadingPlugin = __webpack_require__(34726); const JsonpChunkLoadingRuntimeModule = __webpack_require__(66032); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compiler")} Compiler */ class JsonpTemplatePlugin { /** * @deprecated use JsonpChunkLoadingRuntimeModule.getCompilationHooks instead * @param {Compilation} compilation the compilation * @returns {JsonpChunkLoadingRuntimeModule.JsonpCompilationPluginHooks} hooks */ static getCompilationHooks(compilation) { return JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation); } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.options.output.chunkLoading = "jsonp"; new ArrayPushCallbackChunkFormatPlugin().apply(compiler); new EnableChunkLoadingPlugin("jsonp").apply(compiler); } } module.exports = JsonpTemplatePlugin; /***/ }), /***/ 86128: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const util = __webpack_require__(31669); const webpackOptionsSchemaCheck = __webpack_require__(97220); const webpackOptionsSchema = __webpack_require__(1863); const Compiler = __webpack_require__(11777); const MultiCompiler = __webpack_require__(73663); const WebpackOptionsApply = __webpack_require__(44137); const { applyWebpackOptionsDefaults, applyWebpackOptionsBaseDefaults } = __webpack_require__(27057); const { getNormalizedWebpackOptions } = __webpack_require__(52975); const NodeEnvironmentPlugin = __webpack_require__(38857); const memoize = __webpack_require__(84297); /** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ /** @typedef {import("./Compiler").WatchOptions} WatchOptions */ /** @typedef {import("./MultiCompiler").MultiCompilerOptions} MultiCompilerOptions */ /** @typedef {import("./MultiStats")} MultiStats */ /** @typedef {import("./Stats")} Stats */ const getValidateSchema = memoize(() => __webpack_require__(55959)); /** * @template T * @callback Callback * @param {Error=} err * @param {T=} stats * @returns {void} */ /** * @param {ReadonlyArray} childOptions options array * @param {MultiCompilerOptions} options options * @returns {MultiCompiler} a multi-compiler */ const createMultiCompiler = (childOptions, options) => { const compilers = childOptions.map(options => createCompiler(options)); const compiler = new MultiCompiler(compilers, options); for (const childCompiler of compilers) { if (childCompiler.options.dependencies) { compiler.setDependencies( childCompiler, childCompiler.options.dependencies ); } } return compiler; }; /** * @param {WebpackOptions} rawOptions options object * @returns {Compiler} a compiler */ const createCompiler = rawOptions => { const options = getNormalizedWebpackOptions(rawOptions); applyWebpackOptionsBaseDefaults(options); const compiler = new Compiler(options.context, options); new NodeEnvironmentPlugin({ infrastructureLogging: options.infrastructureLogging }).apply(compiler); if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === "function") { plugin.call(compiler, compiler); } else { plugin.apply(compiler); } } } applyWebpackOptionsDefaults(options); compiler.hooks.environment.call(); compiler.hooks.afterEnvironment.call(); new WebpackOptionsApply().process(options, compiler); compiler.hooks.initialize.call(); return compiler; }; /** * @callback WebpackFunctionSingle * @param {WebpackOptions} options options object * @param {Callback=} callback callback * @returns {Compiler} the compiler object */ /** * @callback WebpackFunctionMulti * @param {ReadonlyArray & MultiCompilerOptions} options options objects * @param {Callback=} callback callback * @returns {MultiCompiler} the multi compiler object */ const asArray = options => Array.isArray(options) ? Array.from(options) : [options]; const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ ( /** * @param {WebpackOptions | (ReadonlyArray & MultiCompilerOptions)} options options * @param {Callback & Callback=} callback callback * @returns {Compiler | MultiCompiler} */ (options, callback) => { const create = () => { if (!asArray(options).every(webpackOptionsSchemaCheck)) { getValidateSchema()(webpackOptionsSchema, options); util.deprecate( () => {}, "webpack bug: Pre-compiled schema reports error while real schema is happy. This has performance drawbacks.", "DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID" )(); } /** @type {MultiCompiler|Compiler} */ let compiler; let watch = false; /** @type {WatchOptions|WatchOptions[]} */ let watchOptions; if (Array.isArray(options)) { /** @type {MultiCompiler} */ compiler = createMultiCompiler( options, /** @type {MultiCompilerOptions} */ (options) ); watch = options.some(options => options.watch); watchOptions = options.map(options => options.watchOptions || {}); } else { const webpackOptions = /** @type {WebpackOptions} */ (options); /** @type {Compiler} */ compiler = createCompiler(webpackOptions); watch = webpackOptions.watch; watchOptions = webpackOptions.watchOptions || {}; } return { compiler, watch, watchOptions }; }; if (callback) { try { const { compiler, watch, watchOptions } = create(); if (watch) { compiler.watch(watchOptions, callback); } else { compiler.run((err, stats) => { compiler.close(err2 => { callback(err || err2, stats); }); }); } return compiler; } catch (err) { process.nextTick(() => callback(err)); return null; } } else { const { compiler, watch } = create(); if (watch) { util.deprecate( () => {}, "A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.", "DEP_WEBPACK_WATCH_WITHOUT_CALLBACK" )(); } return compiler; } } ); module.exports = webpack; /***/ }), /***/ 56354: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const RuntimeGlobals = __webpack_require__(49404); const CreateScriptUrlRuntimeModule = __webpack_require__(41690); const StartupChunkDependenciesPlugin = __webpack_require__(23613); const ImportScriptsChunkLoadingRuntimeModule = __webpack_require__(45936); /** @typedef {import("../Compiler")} Compiler */ class ImportScriptsChunkLoadingPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { new StartupChunkDependenciesPlugin({ chunkLoading: "import-scripts", asyncChunkLoading: true }).apply(compiler); compiler.hooks.thisCompilation.tap( "ImportScriptsChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = options && options.chunkLoading !== undefined ? options.chunkLoading : globalChunkLoading; return chunkLoading === "import-scripts"; }; const onceForChunkSet = new WeakSet(); const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); if (!isEnabledForChunk(chunk)) return; const withCreateScriptUrl = !!compilation.outputOptions.trustedTypes; set.add(RuntimeGlobals.moduleFactoriesAddOnly); set.add(RuntimeGlobals.hasOwnProperty); if (withCreateScriptUrl) set.add(RuntimeGlobals.createScriptUrl); compilation.addRuntimeModule( chunk, new ImportScriptsChunkLoadingRuntimeModule(set, withCreateScriptUrl) ); }; compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.ensureChunkHandlers) .tap("ImportScriptsChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadUpdateHandlers) .tap("ImportScriptsChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadManifest) .tap("ImportScriptsChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.baseURI) .tap("ImportScriptsChunkLoadingPlugin", handler); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.createScriptUrl) .tap("RuntimePlugin", (chunk, set) => { compilation.addRuntimeModule( chunk, new CreateScriptUrlRuntimeModule() ); return true; }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.ensureChunkHandlers) .tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.getChunkScriptFilename); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadUpdateHandlers) .tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.getChunkUpdateScriptFilename); set.add(RuntimeGlobals.moduleCache); set.add(RuntimeGlobals.hmrModuleData); set.add(RuntimeGlobals.moduleFactoriesAddOnly); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.hmrDownloadManifest) .tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => { if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.getUpdateManifestFilename); }); } ); } } module.exports = ImportScriptsChunkLoadingPlugin; /***/ }), /***/ 45936: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php */ const RuntimeGlobals = __webpack_require__(49404); const RuntimeModule = __webpack_require__(61439); const Template = __webpack_require__(92066); const { getChunkFilenameTemplate, chunkHasJs } = __webpack_require__(76767); const { getInitialChunkIds } = __webpack_require__(30951); const compileBooleanMatcher = __webpack_require__(356); const { getUndoPath } = __webpack_require__(96236); class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { constructor(runtimeRequirements, withCreateScriptUrl) { super("importScripts chunk loading", RuntimeModule.STAGE_ATTACH); this.runtimeRequirements = runtimeRequirements; this._withCreateScriptUrl = withCreateScriptUrl; } /** * @returns {string} runtime code */ generate() { const { chunk, chunkGraph, compilation: { runtimeTemplate, outputOptions: { globalObject, chunkLoadingGlobal, hotUpdateGlobal } }, _withCreateScriptUrl: withCreateScriptUrl } = this; const fn = RuntimeGlobals.ensureChunkHandlers; const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI); const withLoading = this.runtimeRequirements.has( RuntimeGlobals.ensureChunkHandlers ); const withHmr = this.runtimeRequirements.has( RuntimeGlobals.hmrDownloadUpdateHandlers ); const withHmrManifest = this.runtimeRequirements.has( RuntimeGlobals.hmrDownloadManifest ); const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify( chunkLoadingGlobal )}]`; const hasJsMatcher = compileBooleanMatcher( chunkGraph.getChunkConditionMap(chunk, chunkHasJs) ); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph); const outputName = this.compilation.getPath( getChunkFilenameTemplate(chunk, this.compilation.outputOptions), { chunk, contentHashType: "javascript" } ); const rootOutputDir = getUndoPath( outputName, this.compilation.outputOptions.path, false ); const stateExpression = withHmr ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_importScripts` : undefined; return Template.asString([ withBaseURI ? Template.asString([ `${RuntimeGlobals.baseURI} = self.location + ${JSON.stringify( rootOutputDir ? "/../" + rootOutputDir : "" )};` ]) : "// no baseURI", "", "// object to store loaded chunks", '// "1" means "already loaded"', `var installedChunks = ${ stateExpression ? `${stateExpression} = ${stateExpression} || ` : "" }{`, Template.indent( Array.from(initialChunkIds, id => `${JSON.stringify(id)}: 1`).join( ",\n" ) ), "};", "", withLoading ? Template.asString([ "// importScripts chunk loading", `var installChunk = ${runtimeTemplate.basicFunction("data", [ runtimeTemplate.destructureArray( ["chunkIds", "moreModules", "runtime"], "data" ), "for(var moduleId in moreModules) {", Template.indent([ `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`, Template.indent( `${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];` ), "}" ]), "}", "if(runtime) runtime(__webpack_require__);", "while(chunkIds.length)", Template.indent("installedChunks[chunkIds.pop()] = 1;"), "parentChunkLoadingFunction(data);" ])};` ]) : "// no chunk install function needed", withLoading ? Template.asString([ `${fn}.i = ${runtimeTemplate.basicFunction( "chunkId, promises", hasJsMatcher !== false ? [ '// "1" is the signal for "already loaded"', "if(!installedChunks[chunkId]) {", Template.indent([ hasJsMatcher === true ? "if(true) { // all chunks have JS" : `if(${hasJsMatcher("chunkId")}) {`, Template.indent( `importScripts(${ withCreateScriptUrl ? `${RuntimeGlobals.createScriptUrl}(${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId))` : `${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId)` });` ), "}" ]), "}" ] : "installedChunks[chunkId] = 1;" )};`, "", `var chunkLoadingGlobal = ${chunkLoadingGlobalExpr} = ${chunkLoadingGlobalExpr} || [];`, "var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);", "chunkLoadingGlobal.push = installChunk;" ]) : "// no chunk loading", "", withHmr ? Template.asString([ "function loadUpdateChunk(chunkId, updatedModulesList) {", Template.indent([ "var success = false;", `${globalObject}[${JSON.stringify( hotUpdateGlobal )}] = ${runtimeTemplate.basicFunction("_, moreModules, runtime", [ "for(var moduleId in moreModules) {", Template.indent([ `if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`, Template.indent([ "currentUpdate[moduleId] = moreModules[moduleId];", "if(updatedModulesList) updatedModulesList.push(moduleId);" ]), "}" ]), "}", "if(runtime) currentUpdateRuntime.push(runtime);", "success = true;" ])};`, "// start update chunk loading", `importScripts(${ withCreateScriptUrl ? `${RuntimeGlobals.createScriptUrl}(${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId))` : `${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId)` });`, 'if(!success) throw new Error("Loading update chunk failed for unknown reason");' ]), "}", "", Template.getFunctionContent( require('./JavascriptHotModuleReplacement.runtime.js') ) .replace(/\$key\$/g, "importScrips") .replace(/\$installedChunks\$/g, "installedChunks") .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) .replace( /\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers ) .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) .replace( /\$hmrDownloadUpdateHandlers\$/g, RuntimeGlobals.hmrDownloadUpdateHandlers ) .replace( /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) ]) : "// no HMR", "", withHmrManifest ? Template.asString([ `${ RuntimeGlobals.hmrDownloadManifest } = ${runtimeTemplate.basicFunction("", [ 'if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");', `return fetch(${RuntimeGlobals.publicPath} + ${ RuntimeGlobals.getUpdateManifestFilename }()).then(${runtimeTemplate.basicFunction("response", [ "if(response.status === 404) return; // no update available", 'if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);', "return response.json();" ])});` ])};` ]) : "// no HMR manifest" ]); } } module.exports = ImportScriptsChunkLoadingRuntimeModule; /***/ }), /***/ 9460: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(86189); const EnableChunkLoadingPlugin = __webpack_require__(34726); /** @typedef {import("../Compiler")} Compiler */ class WebWorkerTemplatePlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.options.output.chunkLoading = "import-scripts"; new ArrayPushCallbackChunkFormatPlugin().apply(compiler); new EnableChunkLoadingPlugin("import-scripts").apply(compiler); } } module.exports = WebWorkerTemplatePlugin; /***/ }), /***/ 94469: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const DescriptionFileUtils = __webpack_require__(18641); const getInnerRequest = __webpack_require__(98361); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class AliasFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | Array} field field * @param {string | ResolveStepHook} target target */ constructor(source, field, target) { this.source = source; this.field = field; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { if (!request.descriptionFileData) return callback(); const innerRequest = getInnerRequest(resolver, request); if (!innerRequest) return callback(); const fieldData = DescriptionFileUtils.getField( request.descriptionFileData, this.field ); if (fieldData === null || typeof fieldData !== "object") { if (resolveContext.log) resolveContext.log( "Field '" + this.field + "' doesn't contain a valid alias configuration" ); return callback(); } const data1 = fieldData[innerRequest]; const data2 = fieldData[innerRequest.replace(/^\.\//, "")]; const data = typeof data1 !== "undefined" ? data1 : data2; if (data === innerRequest) return callback(); if (data === undefined) return callback(); if (data === false) { /** @type {ResolveRequest} */ const ignoreObj = { ...request, path: false }; return callback(null, ignoreObj); } const obj = { ...request, path: request.descriptionFileRoot, request: data, fullySpecified: false }; resolver.doResolve( target, obj, "aliased from description file " + request.descriptionFilePath + " with mapping '" + innerRequest + "' to '" + data + "'", resolveContext, (err, result) => { if (err) return callback(err); // Don't allow other aliasing or raw request if (result === undefined) return callback(null, null); callback(null, result); } ); }); } }; /***/ }), /***/ 42673: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const forEachBail = __webpack_require__(55426); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {{alias: string|Array|false, name: string, onlyModule?: boolean}} AliasOption */ module.exports = class AliasPlugin { /** * @param {string | ResolveStepHook} source source * @param {AliasOption | Array} options options * @param {string | ResolveStepHook} target target */ constructor(source, options, target) { this.source = source; this.options = Array.isArray(options) ? options : [options]; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("AliasPlugin", (request, resolveContext, callback) => { const innerRequest = request.request || request.path; if (!innerRequest) return callback(); forEachBail( this.options, (item, callback) => { let shouldStop = false; if ( innerRequest === item.name || (!item.onlyModule && innerRequest.startsWith(item.name + "/")) ) { const remainingRequest = innerRequest.substr(item.name.length); const resolveWithAlias = (alias, callback) => { if (alias === false) { const ignoreObj = { ...request, path: false }; return callback(null, ignoreObj); } if ( innerRequest !== alias && !innerRequest.startsWith(alias + "/") ) { shouldStop = true; const newRequestStr = alias + remainingRequest; const obj = { ...request, request: newRequestStr, fullySpecified: false }; return resolver.doResolve( target, obj, "aliased with mapping '" + item.name + "': '" + alias + "' to '" + newRequestStr + "'", resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); return callback(); } ); } return callback(); }; const stoppingCallback = (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Don't allow other aliasing or raw request if (shouldStop) return callback(null, null); return callback(); }; if (Array.isArray(item.alias)) { return forEachBail( item.alias, resolveWithAlias, stoppingCallback ); } else { return resolveWithAlias(item.alias, stoppingCallback); } } return callback(); }, callback ); }); } }; /***/ }), /***/ 72405: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class AppendPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} appending appending * @param {string | ResolveStepHook} target target */ constructor(source, appending, target) { this.source = source; this.appending = appending; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("AppendPlugin", (request, resolveContext, callback) => { const obj = { ...request, path: request.path + this.appending, relativePath: request.relativePath && request.relativePath + this.appending }; resolver.doResolve( target, obj, this.appending, resolveContext, callback ); }); } }; /***/ }), /***/ 26785: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const nextTick = __webpack_require__(61765).nextTick; /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ const dirname = path => { let idx = path.length - 1; while (idx >= 0) { const c = path.charCodeAt(idx); // slash or backslash if (c === 47 || c === 92) break; idx--; } if (idx < 0) return ""; return path.slice(0, idx); }; const runCallbacks = (callbacks, err, result) => { if (callbacks.length === 1) { callbacks[0](err, result); callbacks.length = 0; return; } let error; for (const callback of callbacks) { try { callback(err, result); } catch (e) { if (!error) error = e; } } callbacks.length = 0; if (error) throw error; }; class OperationMergerBackend { /** * @param {any} provider async method * @param {any} syncProvider sync method * @param {any} providerContext call context for the provider methods */ constructor(provider, syncProvider, providerContext) { const activeAsyncOperations = new Map(); this.provide = provider ? (path, options, callback) => { if (typeof options === "function") { callback = options; options = undefined; } if (options) { return provider.call(providerContext, path, options, callback); } if (typeof path !== "string") { callback(new TypeError("path must be a string")); return; } let callbacks = activeAsyncOperations.get(path); if (callbacks) { callbacks.push(callback); return; } activeAsyncOperations.set(path, (callbacks = [callback])); provider.call(providerContext, path, (err, result) => { activeAsyncOperations.delete(path); runCallbacks(callbacks, err, result); }); } : null; this.provideSync = syncProvider ? (path, options) => { return syncProvider.call(providerContext, path, options); } : null; this.provideCustom = provider ? (provider, providerContext, path, callback) => { let callbacks = activeAsyncOperations.get(path); if (callbacks) { callbacks.push(callback); return; } activeAsyncOperations.set(path, (callbacks = [callback])); provider.call(providerContext, path, (err, result) => { activeAsyncOperations.delete(path); runCallbacks(callbacks, err, result); }); } : null; this.provideCustomSync = syncProvider ? (syncProvider, providerContext, path) => { return syncProvider.call(providerContext, path); } : null; } purge() {} purgeParent() {} } /* IDLE: insert data: goto SYNC SYNC: before provide: run ticks event loop tick: goto ASYNC_ACTIVE ASYNC: timeout: run tick, goto ASYNC_PASSIVE ASYNC_PASSIVE: before provide: run ticks IDLE --[insert data]--> SYNC --[event loop tick]--> ASYNC_ACTIVE --[interval tick]-> ASYNC_PASSIVE ^ | +---------[insert data]-------+ */ const STORAGE_MODE_IDLE = 0; const STORAGE_MODE_SYNC = 1; const STORAGE_MODE_ASYNC = 2; class CacheBackend { /** * @param {number} duration max cache duration of items * @param {any} provider async method * @param {any} syncProvider sync method * @param {any} providerContext call context for the provider methods */ constructor(duration, provider, syncProvider, providerContext) { this._duration = duration; this._provider = provider; this._syncProvider = syncProvider; this._providerContext = providerContext; /** @type {Map} */ this._activeAsyncOperations = new Map(); /** @type {Map }>} */ this._data = new Map(); /** @type {Set[]} */ this._levels = []; for (let i = 0; i < 10; i++) this._levels.push(new Set()); for (let i = 5000; i < duration; i += 500) this._levels.push(new Set()); this._currentLevel = 0; this._tickInterval = Math.floor(duration / this._levels.length); /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ this._mode = STORAGE_MODE_IDLE; /** @type {NodeJS.Timeout | undefined} */ this._timeout = undefined; /** @type {number | undefined} */ this._nextDecay = undefined; this.provide = provider ? this.provide.bind(this) : null; this.provideSync = syncProvider ? this.provideSync.bind(this) : null; this.provideCustom = provider ? this.provideCustom.bind(this) : null; this.provideCustomSync = syncProvider ? this.provideCustomSync.bind(this) : null; } provide(path, options, callback) { if (typeof options === "function") { callback = options; options = undefined; } if (typeof path !== "string") { callback(new TypeError("path must be a string")); return; } if (options) { return this._provider.call( this._providerContext, path, options, callback ); } // When in sync mode we can move to async mode if (this._mode === STORAGE_MODE_SYNC) { this._enterAsyncMode(); } // Check in cache let cacheEntry = this._data.get(path); if (cacheEntry !== undefined) { if (cacheEntry.err) return nextTick(callback, cacheEntry.err); return nextTick(callback, null, cacheEntry.result); } // Check if there is already the same operation running let callbacks = this._activeAsyncOperations.get(path); if (callbacks !== undefined) { callbacks.push(callback); return; } this._activeAsyncOperations.set(path, (callbacks = [callback])); // Run the operation this._provider.call(this._providerContext, path, (err, result) => { this._activeAsyncOperations.delete(path); this._storeResult(path, err, result); // Enter async mode if not yet done this._enterAsyncMode(); runCallbacks(callbacks, err, result); }); } provideSync(path, options) { if (typeof path !== "string") { throw new TypeError("path must be a string"); } if (options) { return this._syncProvider.call(this._providerContext, path, options); } // In sync mode we may have to decay some cache items if (this._mode === STORAGE_MODE_SYNC) { this._runDecays(); } // Check in cache let cacheEntry = this._data.get(path); if (cacheEntry !== undefined) { if (cacheEntry.err) throw cacheEntry.err; return cacheEntry.result; } // Get all active async operations // This sync operation will also complete them const callbacks = this._activeAsyncOperations.get(path); this._activeAsyncOperations.delete(path); // Run the operation // When in idle mode, we will enter sync mode let result; try { result = this._syncProvider.call(this._providerContext, path); } catch (err) { this._storeResult(path, err, undefined); this._enterSyncModeWhenIdle(); if (callbacks) runCallbacks(callbacks, err, undefined); throw err; } this._storeResult(path, undefined, result); this._enterSyncModeWhenIdle(); if (callbacks) runCallbacks(callbacks, undefined, result); return result; } provideCustom(provider, providerContext, path, callback) { // When in sync mode we can move to async mode if (this._mode === STORAGE_MODE_SYNC) { this._enterAsyncMode(); } // Check in cache let cacheEntry = this._data.get(path); if (cacheEntry !== undefined) { if (cacheEntry.err) return nextTick(callback, cacheEntry.err); return nextTick(callback, null, cacheEntry.result); } // Check if there is already the same operation running let callbacks = this._activeAsyncOperations.get(path); if (callbacks !== undefined) { callbacks.push(callback); return; } this._activeAsyncOperations.set(path, (callbacks = [callback])); // Run the operation provider.call(providerContext, path, (err, result) => { this._activeAsyncOperations.delete(path); this._storeResult(path, err, result); // Enter async mode if not yet done this._enterAsyncMode(); runCallbacks(callbacks, err, result); }); } provideCustomSync(provider, providerContext, path) { // In sync mode we may have to decay some cache items if (this._mode === STORAGE_MODE_SYNC) { this._runDecays(); } // Check in cache let cacheEntry = this._data.get(path); if (cacheEntry !== undefined) { if (cacheEntry.err) throw cacheEntry.err; return cacheEntry.result; } // Get all active async operations // This sync operation will also complete them const callbacks = this._activeAsyncOperations.get(path); this._activeAsyncOperations.delete(path); // Run the operation // When in idle mode, we will enter sync mode let result; try { result = provider.call(providerContext, path); } catch (err) { this._storeResult(path, err, undefined); this._enterSyncModeWhenIdle(); if (callbacks) runCallbacks(callbacks, err, undefined); throw err; } this._storeResult(path, undefined, result); this._enterSyncModeWhenIdle(); if (callbacks) runCallbacks(callbacks, undefined, result); return result; } purge(what) { if (!what) { if (this._mode !== STORAGE_MODE_IDLE) { this._data.clear(); for (const level of this._levels) { level.clear(); } this._enterIdleMode(); } } else if (typeof what === "string") { for (let [key, data] of this._data) { if (key.startsWith(what)) { this._data.delete(key); data.level.delete(key); } } if (this._data.size === 0) { this._enterIdleMode(); } } else { for (let [key, data] of this._data) { for (const item of what) { if (key.startsWith(item)) { this._data.delete(key); data.level.delete(key); break; } } } if (this._data.size === 0) { this._enterIdleMode(); } } } purgeParent(what) { if (!what) { this.purge(); } else if (typeof what === "string") { this.purge(dirname(what)); } else { const set = new Set(); for (const item of what) { set.add(dirname(item)); } this.purge(set); } } _storeResult(path, err, result) { if (this._data.has(path)) return; const level = this._levels[this._currentLevel]; this._data.set(path, { err, result, level }); level.add(path); } _decayLevel() { const nextLevel = (this._currentLevel + 1) % this._levels.length; const decay = this._levels[nextLevel]; this._currentLevel = nextLevel; for (let item of decay) { this._data.delete(item); } decay.clear(); if (this._data.size === 0) { this._enterIdleMode(); } else { // @ts-ignore _nextDecay is always a number in sync mode this._nextDecay += this._tickInterval; } } _runDecays() { while ( /** @type {number} */ (this._nextDecay) <= Date.now() && this._mode !== STORAGE_MODE_IDLE ) { this._decayLevel(); } } _enterAsyncMode() { let timeout = 0; switch (this._mode) { case STORAGE_MODE_ASYNC: return; case STORAGE_MODE_IDLE: this._nextDecay = Date.now() + this._tickInterval; timeout = this._tickInterval; break; case STORAGE_MODE_SYNC: this._runDecays(); // @ts-ignore _runDecays may change the mode if (this._mode === STORAGE_MODE_IDLE) return; timeout = Math.max( 0, /** @type {number} */ (this._nextDecay) - Date.now() ); break; } this._mode = STORAGE_MODE_ASYNC; const ref = setTimeout(() => { this._mode = STORAGE_MODE_SYNC; this._runDecays(); }, timeout); if (ref.unref) ref.unref(); this._timeout = ref; } _enterSyncModeWhenIdle() { if (this._mode === STORAGE_MODE_IDLE) { this._mode = STORAGE_MODE_SYNC; this._nextDecay = Date.now() + this._tickInterval; } } _enterIdleMode() { this._mode = STORAGE_MODE_IDLE; this._nextDecay = undefined; if (this._timeout) clearTimeout(this._timeout); } } const createBackend = (duration, provider, syncProvider, providerContext) => { if (duration > 0) { return new CacheBackend(duration, provider, syncProvider, providerContext); } return new OperationMergerBackend(provider, syncProvider, providerContext); }; module.exports = class CachedInputFileSystem { constructor(fileSystem, duration) { this.fileSystem = fileSystem; this._lstatBackend = createBackend( duration, this.fileSystem.lstat, this.fileSystem.lstatSync, this.fileSystem ); const lstat = this._lstatBackend.provide; this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); const lstatSync = this._lstatBackend.provideSync; this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ (lstatSync); this._statBackend = createBackend( duration, this.fileSystem.stat, this.fileSystem.statSync, this.fileSystem ); const stat = this._statBackend.provide; const customStat = this._statBackend.provideCustom; this.stat = /** @type {FileSystem["stat"]} */ (stat); const statSync = this._statBackend.provideSync; const customStatSync = this._statBackend.provideCustomSync; this.statSync = /** @type {SyncFileSystem["statSync"]} */ (statSync); this._readdirBackend = createBackend( duration, this.fileSystem.readdir, this.fileSystem.readdirSync, this.fileSystem ); const readdir = this._readdirBackend.provide; this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); const readdirSync = this._readdirBackend.provideSync; this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ (readdirSync); this._readFileBackend = createBackend( duration, this.fileSystem.readFile && this.fileSystem.fstat && this.fileSystem.read && this.fileSystem.open && this.fileSystem.close && customStat ? /** * @this {{ fstat: NonNullable, readFile: NonNullable, open: NonNullable, read: NonNullable, close: NonNullable }} */ function (path, options, callback) { if (typeof options === "function") { callback = options; options = undefined; } if (typeof options === "object") return this.readFile(path, options, callback); this.open(path, "r", (err, fd) => { if (err) return callback(err); if (typeof fd !== "number") return callback(new Error("fd must be a number")); customStat( (path, callback) => this.fstat(fd, callback), null, path, (err, stats) => { if (err) return callback(err); if (stats.size > 0 && stats.size < 128 * 1024) { let remaining = stats.size + 1; const buffer = Buffer.allocUnsafe(remaining); const afterRead = (err, bytesRead) => { if (err) { return this.close(fd, () => { callback(err); }); } remaining -= bytesRead; if (bytesRead === 0 || remaining === 1) { this.close(fd, err => { if (err) return callback(err); return callback( null, buffer.slice(0, buffer.length - remaining) ); }); } else if (remaining === 0) { // The file size has changed from the cached info // We keep reading until the end is found let buf = Buffer.allocUnsafe(16 * 1024); let bufPos = 0; const buffers = [buffer]; const afterUnknownRead = (err, bytesRead) => { if (err) { return this.close(fd, () => { callback(err); }); } bufPos += bytesRead; if (bytesRead === 0) { if (bufPos > 0) buffers.push(buf.slice(0, bufPos)); this.close(fd, err => { if (err) return callback(err); return callback(null, Buffer.concat(buffers)); }); } else { if (bufPos === buf.length) { buffers.push(buf); buf = Buffer.allocUnsafe(16 * 1024); bufPos = 0; } this.read( fd, buf, bufPos, buf.length - bufPos, -1, afterUnknownRead ); } }; this.read( fd, buf, bufPos, buf.length - bufPos, -1, afterUnknownRead ); } else { this.read( fd, buffer, stats.size - remaining, remaining + 1, -1, afterRead ); } }; this.read(fd, buffer, 0, remaining, -1, afterRead); } else { this.readFile(fd, options, (err, buffer) => { this.close(fd, closeErr => { if (err) return callback(err); if (closeErr) return callback(closeErr); callback(null, buffer); }); }); } } ); }); } : this.fileSystem.readFile, this.fileSystem.readFileSync && this.fileSystem.fstatSync && this.fileSystem.readSync && this.fileSystem.openSync && this.fileSystem.closeSync && customStatSync ? /** * @this {{ fstatSync: NonNullable, readFileSync: NonNullable, openSync: NonNullable, readSync: NonNullable, closeSync: NonNullable }} */ function (path, options) { if (typeof options === "object") return this.readFileSync(path, options); const fd = this.openSync(path, "r"); if (typeof fd !== "number") throw new Error("fd must be a number"); const stats = customStatSync(() => this.fstatSync(fd), null, path); if (stats.size > 0 && stats.size < 128 * 1024) { let remaining = stats.size; const buffer = Buffer.allocUnsafe(remaining); try { let bytesRead = this.readSync(fd, buffer, 0, remaining, -1); remaining -= bytesRead; while (bytesRead !== 0 && remaining !== 0) { bytesRead = this.readSync( fd, buffer, stats.size - remaining, remaining, -1 ); remaining -= bytesRead; } return buffer; } finally { this.closeSync(fd); } } else { const buffer = this.readFileSync(fd); this.closeSync(fd); return buffer; } } : this.fileSystem.readFileSync, this.fileSystem ); const readFile = this._readFileBackend.provide; this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); const readFileSync = this._readFileBackend.provideSync; this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ (readFileSync); this._readJsonBackend = createBackend( duration, this.fileSystem.readJson || (this.readFile && ((path, callback) => { // @ts-ignore this.readFile(path, (err, buffer) => { if (err) return callback(err); if (!buffer || buffer.length === 0) return callback(new Error("No file content")); let data; try { data = JSON.parse(buffer.toString("utf-8")); } catch (e) { return callback(e); } callback(null, data); }); })), this.fileSystem.readJsonSync || (this.readFileSync && (path => { const buffer = this.readFileSync(path); const data = JSON.parse(buffer.toString("utf-8")); return data; })), this.fileSystem ); const readJson = this._readJsonBackend.provide; this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); const readJsonSync = this._readJsonBackend.provideSync; this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ (readJsonSync); this._readlinkBackend = createBackend( duration, this.fileSystem.readlink, this.fileSystem.readlinkSync, this.fileSystem ); const readlink = this._readlinkBackend.provide; this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); const readlinkSync = this._readlinkBackend.provideSync; this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ (readlinkSync); } purge(what) { this._statBackend.purge(what); this._lstatBackend.purge(what); this._readdirBackend.purgeParent(what); this._readFileBackend.purge(what); this._readlinkBackend.purge(what); this._readJsonBackend.purge(what); } }; /***/ }), /***/ 36154: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const basename = __webpack_require__(17117).basename; /** @typedef {import("./Resolver")} Resolver */ module.exports = class CloneBasenamePlugin { constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { const filename = basename(request.path); const filePath = resolver.join(request.path, filename); const obj = { ...request, path: filePath, relativePath: request.relativePath && resolver.join(request.relativePath, filename) }; resolver.doResolve( target, obj, "using path: " + filePath, resolveContext, callback ); }); } }; /***/ }), /***/ 13134: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ConditionalPlugin { /** * @param {string | ResolveStepHook} source source * @param {Partial} test compare object * @param {string | null} message log message * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches * @param {string | ResolveStepHook} target target */ constructor(source, test, message, allowAlternatives, target) { this.source = source; this.test = test; this.message = message; this.allowAlternatives = allowAlternatives; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const { test, message, allowAlternatives } = this; const keys = Object.keys(test); resolver .getHook(this.source) .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { for (const prop of keys) { if (request[prop] !== test[prop]) return callback(); } resolver.doResolve( target, request, message, resolveContext, allowAlternatives ? callback : (err, result) => { if (err) return callback(err); // Don't allow other alternatives if (result === undefined) return callback(null, null); callback(null, result); } ); }); } }; /***/ }), /***/ 85774: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const DescriptionFileUtils = __webpack_require__(18641); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class DescriptionFilePlugin { /** * @param {string | ResolveStepHook} source source * @param {string[]} filenames filenames * @param {boolean} pathIsFile pathIsFile * @param {string | ResolveStepHook} target target */ constructor(source, filenames, pathIsFile, target) { this.source = source; this.filenames = filenames; this.pathIsFile = pathIsFile; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "DescriptionFilePlugin", (request, resolveContext, callback) => { const path = request.path; if (!path) return callback(); const directory = this.pathIsFile ? DescriptionFileUtils.cdUp(path) : path; if (!directory) return callback(); DescriptionFileUtils.loadDescriptionFile( resolver, directory, this.filenames, request.descriptionFilePath ? { path: request.descriptionFilePath, content: request.descriptionFileData, directory: /** @type {string} */ (request.descriptionFileRoot) } : undefined, resolveContext, (err, result) => { if (err) return callback(err); if (!result) { if (resolveContext.log) resolveContext.log( `No description file found in ${directory} or above` ); return callback(); } const relativePath = "." + path.substr(result.directory.length).replace(/\\/g, "/"); const obj = { ...request, descriptionFilePath: result.path, descriptionFileData: result.content, descriptionFileRoot: result.directory, relativePath: relativePath }; resolver.doResolve( target, obj, "using description file: " + result.path + " (relative path: " + relativePath + ")", resolveContext, (err, result) => { if (err) return callback(err); // Don't allow other processing if (result === undefined) return callback(null, null); callback(null, result); } ); } ); } ); } }; /***/ }), /***/ 18641: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const forEachBail = __webpack_require__(55426); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** * @typedef {Object} DescriptionFileInfo * @property {any=} content * @property {string} path * @property {string} directory */ /** * @callback ErrorFirstCallback * @param {Error|null=} error * @param {DescriptionFileInfo=} result */ /** * @param {Resolver} resolver resolver * @param {string} directory directory * @param {string[]} filenames filenames * @param {DescriptionFileInfo|undefined} oldInfo oldInfo * @param {ResolveContext} resolveContext resolveContext * @param {ErrorFirstCallback} callback callback */ function loadDescriptionFile( resolver, directory, filenames, oldInfo, resolveContext, callback ) { (function findDescriptionFile() { if (oldInfo && oldInfo.directory === directory) { // We already have info for this directory and can reuse it return callback(null, oldInfo); } forEachBail( filenames, (filename, callback) => { const descriptionFilePath = resolver.join(directory, filename); if (resolver.fileSystem.readJson) { resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { if (err) { if (typeof err.code !== "undefined") { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(descriptionFilePath); } return callback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } return onJson(err); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } onJson(null, content); }); } else { resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { if (err) { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(descriptionFilePath); } return callback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } let json; if (content) { try { json = JSON.parse(content.toString()); } catch (e) { return onJson(e); } } else { return onJson(new Error("No content in file")); } onJson(null, json); }); } function onJson(err, content) { if (err) { if (resolveContext.log) resolveContext.log( descriptionFilePath + " (directory description file): " + err ); else err.message = descriptionFilePath + " (directory description file): " + err; return callback(err); } callback(null, { content, directory, path: descriptionFilePath }); } }, (err, result) => { if (err) return callback(err); if (result) { return callback(null, result); } else { const dir = cdUp(directory); if (!dir) { return callback(); } else { directory = dir; return findDescriptionFile(); } } } ); })(); } /** * @param {any} content content * @param {string|string[]} field field * @returns {object|string|number|boolean|undefined} field data */ function getField(content, field) { if (!content) return undefined; if (Array.isArray(field)) { let current = content; for (let j = 0; j < field.length; j++) { if (current === null || typeof current !== "object") { current = null; break; } current = current[field[j]]; } return current; } else { return content[field]; } } /** * @param {string} directory directory * @returns {string|null} parent directory or null */ function cdUp(directory) { if (directory === "/") return null; const i = directory.lastIndexOf("/"), j = directory.lastIndexOf("\\"); const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; if (p < 0) return null; return directory.substr(0, p || 1); } exports.loadDescriptionFile = loadDescriptionFile; exports.getField = getField; exports.cdUp = cdUp; /***/ }), /***/ 61827: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class DirectoryExistsPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "DirectoryExistsPlugin", (request, resolveContext, callback) => { const fs = resolver.fileSystem; const directory = request.path; if (!directory) return callback(); fs.stat(directory, (err, stat) => { if (err || !stat) { if (resolveContext.missingDependencies) resolveContext.missingDependencies.add(directory); if (resolveContext.log) resolveContext.log(directory + " doesn't exist"); return callback(); } if (!stat.isDirectory()) { if (resolveContext.missingDependencies) resolveContext.missingDependencies.add(directory); if (resolveContext.log) resolveContext.log(directory + " is not a directory"); return callback(); } if (resolveContext.fileDependencies) resolveContext.fileDependencies.add(directory); resolver.doResolve( target, request, `existing directory ${directory}`, resolveContext, callback ); }); } ); } }; /***/ }), /***/ 98169: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ const path = __webpack_require__(85622); const DescriptionFileUtils = __webpack_require__(18641); const forEachBail = __webpack_require__(55426); const { processExportsField } = __webpack_require__(94340); const { parseIdentifier } = __webpack_require__(98623); const { checkExportsFieldTarget } = __webpack_require__(69821); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ module.exports = class ExportsFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} conditionNames condition names * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} target target */ constructor(source, conditionNames, fieldNamePath, target) { this.source = source; this.target = target; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; /** @type {WeakMap} */ this.fieldProcessorCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("ExportsFieldPlugin", (request, resolveContext, callback) => { // When there is no description file, abort if (!request.descriptionFilePath) return callback(); if ( // When the description file is inherited from parent, abort // (There is no description file inside of this package) request.relativePath !== "." || request.request === undefined ) return callback(); const remainingRequest = request.query || request.fragment ? (request.request === "." ? "./" : request.request) + request.query + request.fragment : request.request; /** @type {ExportsField|null} */ const exportsField = DescriptionFileUtils.getField( request.descriptionFileData, this.fieldName ); if (!exportsField) return callback(); if (request.directory) { return callback( new Error( `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)` ) ); } let paths; try { // We attach the cache to the description file instead of the exportsField value // because we use a WeakMap and the exportsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( request.descriptionFileData ); if (fieldProcessor === undefined) { fieldProcessor = processExportsField(exportsField); this.fieldProcessorCache.set( request.descriptionFileData, fieldProcessor ); } paths = fieldProcessor(remainingRequest, this.conditionNames); } catch (err) { if (resolveContext.log) { resolveContext.log( `Exports field in ${request.descriptionFilePath} can't be processed: ${err}` ); } return callback(err); } if (paths.length === 0) { return callback( new Error( `Package path ${remainingRequest} is not exported from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})` ) ); } forEachBail( paths, (p, callback) => { const parsedIdentifier = parseIdentifier(p); if (!parsedIdentifier) return callback(); const [relativePath, query, fragment] = parsedIdentifier; const error = checkExportsFieldTarget(relativePath); if (error) { return callback(error); } const obj = { ...request, request: undefined, path: path.join( /** @type {string} */ (request.descriptionFileRoot), relativePath ), relativePath, query, fragment }; resolver.doResolve( target, obj, "using exports field: " + p, resolveContext, callback ); }, (err, result) => callback(err, result || null) ); }); } }; /***/ }), /***/ 9412: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class FileExistsPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const fs = resolver.fileSystem; resolver .getHook(this.source) .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { const file = request.path; if (!file) return callback(); fs.stat(file, (err, stat) => { if (err || !stat) { if (resolveContext.missingDependencies) resolveContext.missingDependencies.add(file); if (resolveContext.log) resolveContext.log(file + " doesn't exist"); return callback(); } if (!stat.isFile()) { if (resolveContext.missingDependencies) resolveContext.missingDependencies.add(file); if (resolveContext.log) resolveContext.log(file + " is not a file"); return callback(); } if (resolveContext.fileDependencies) resolveContext.fileDependencies.add(file); resolver.doResolve( target, request, "existing file: " + file, resolveContext, callback ); }); }); } }; /***/ }), /***/ 41031: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ const path = __webpack_require__(85622); const DescriptionFileUtils = __webpack_require__(18641); const forEachBail = __webpack_require__(55426); const { processImportsField } = __webpack_require__(94340); const { parseIdentifier } = __webpack_require__(98623); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ /** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ const dotCode = ".".charCodeAt(0); module.exports = class ImportsFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} conditionNames condition names * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} targetFile target file * @param {string | ResolveStepHook} targetPackage target package */ constructor( source, conditionNames, fieldNamePath, targetFile, targetPackage ) { this.source = source; this.targetFile = targetFile; this.targetPackage = targetPackage; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; /** @type {WeakMap} */ this.fieldProcessorCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const targetFile = resolver.ensureHook(this.targetFile); const targetPackage = resolver.ensureHook(this.targetPackage); resolver .getHook(this.source) .tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => { // When there is no description file, abort if (!request.descriptionFilePath || request.request === undefined) { return callback(); } const remainingRequest = request.request + request.query + request.fragment; /** @type {ImportsField|null} */ const importsField = DescriptionFileUtils.getField( request.descriptionFileData, this.fieldName ); if (!importsField) return callback(); if (request.directory) { return callback( new Error( `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)` ) ); } let paths; try { // We attach the cache to the description file instead of the importsField value // because we use a WeakMap and the importsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( request.descriptionFileData ); if (fieldProcessor === undefined) { fieldProcessor = processImportsField(importsField); this.fieldProcessorCache.set( request.descriptionFileData, fieldProcessor ); } paths = fieldProcessor(remainingRequest, this.conditionNames); } catch (err) { if (resolveContext.log) { resolveContext.log( `Imports field in ${request.descriptionFilePath} can't be processed: ${err}` ); } return callback(err); } if (paths.length === 0) { return callback( new Error( `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})` ) ); } forEachBail( paths, (p, callback) => { const parsedIdentifier = parseIdentifier(p); if (!parsedIdentifier) return callback(); const [path_, query, fragment] = parsedIdentifier; switch (path_.charCodeAt(0)) { // should be relative case dotCode: { const obj = { ...request, request: undefined, path: path.join( /** @type {string} */ (request.descriptionFileRoot), path_ ), relativePath: path_, query, fragment }; resolver.doResolve( targetFile, obj, "using imports field: " + p, resolveContext, callback ); break; } // package resolving default: { const obj = { ...request, request: path_, relativePath: path_, fullySpecified: true, query, fragment }; resolver.doResolve( targetPackage, obj, "using imports field: " + p, resolveContext, callback ); } } }, (err, result) => callback(err, result || null) ); }); } }; /***/ }), /***/ 11399: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const namespaceStartCharCode = "@".charCodeAt(0); module.exports = class JoinRequestPartPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "JoinRequestPartPlugin", (request, resolveContext, callback) => { const req = request.request || ""; let i = req.indexOf("/", 3); if (i >= 0 && req.charCodeAt(2) === namespaceStartCharCode) { i = req.indexOf("/", i + 1); } let moduleName, remainingRequest, fullySpecified; if (i < 0) { moduleName = req; remainingRequest = "."; fullySpecified = false; } else { moduleName = req.slice(0, i); remainingRequest = "." + req.slice(i); fullySpecified = request.fullySpecified; } const obj = { ...request, path: resolver.join(request.path, moduleName), relativePath: request.relativePath && resolver.join(request.relativePath, moduleName), request: remainingRequest, fullySpecified }; resolver.doResolve(target, obj, null, resolveContext, callback); } ); } }; /***/ }), /***/ 90522: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class JoinRequestPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { const obj = { ...request, path: resolver.join(request.path, request.request), relativePath: request.relativePath && resolver.join(request.relativePath, request.request), request: undefined }; resolver.doResolve(target, obj, null, resolveContext, callback); }); } }; /***/ }), /***/ 50098: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ module.exports = class LogInfoPlugin { constructor(source) { this.source = source; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const source = this.source; resolver .getHook(this.source) .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { if (!resolveContext.log) return callback(); const log = resolveContext.log; const prefix = "[" + source + "] "; if (request.path) log(prefix + "Resolving in directory: " + request.path); if (request.request) log(prefix + "Resolving request: " + request.request); if (request.module) log(prefix + "Request is an module request."); if (request.directory) log(prefix + "Request is a directory request."); if (request.query) log(prefix + "Resolving request query: " + request.query); if (request.fragment) log(prefix + "Resolving request fragment: " + request.fragment); if (request.descriptionFilePath) log( prefix + "Has description data from " + request.descriptionFilePath ); if (request.relativePath) log( prefix + "Relative path from description file is: " + request.relativePath ); callback(); }); } }; /***/ }), /***/ 18425: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const path = __webpack_require__(85622); const DescriptionFileUtils = __webpack_require__(18641); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {{name: string|Array, forceRelative: boolean}} MainFieldOptions */ const alreadyTriedMainField = Symbol("alreadyTriedMainField"); module.exports = class MainFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {MainFieldOptions} options options * @param {string | ResolveStepHook} target target */ constructor(source, options, target) { this.source = source; this.options = options; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { if ( request.path !== request.descriptionFileRoot || request[alreadyTriedMainField] === request.descriptionFilePath || !request.descriptionFilePath ) return callback(); const filename = path.basename(request.descriptionFilePath); let mainModule = DescriptionFileUtils.getField( request.descriptionFileData, this.options.name ); if ( !mainModule || typeof mainModule !== "string" || mainModule === "." || mainModule === "./" ) { return callback(); } if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) mainModule = "./" + mainModule; const obj = { ...request, request: mainModule, module: false, directory: mainModule.endsWith("/"), [alreadyTriedMainField]: request.descriptionFilePath }; return resolver.doResolve( target, obj, "use " + mainModule + " from " + this.options.name + " in " + filename, resolveContext, callback ); }); } }; /***/ }), /***/ 44964: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const forEachBail = __webpack_require__(55426); const getPaths = __webpack_require__(17117); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInHierachicDirectoriesPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | Array} directories directories * @param {string | ResolveStepHook} target target */ constructor(source, directories, target) { this.source = source; this.directories = /** @type {Array} */ ([]).concat(directories); this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "ModulesInHierachicDirectoriesPlugin", (request, resolveContext, callback) => { const fs = resolver.fileSystem; const addrs = getPaths(request.path) .paths.map(p => { return this.directories.map(d => resolver.join(p, d)); }) .reduce((array, p) => { array.push.apply(array, p); return array; }, []); forEachBail( addrs, (addr, callback) => { fs.stat(addr, (err, stat) => { if (!err && stat && stat.isDirectory()) { const obj = { ...request, path: addr, request: "./" + request.request, module: false }; const message = "looking for modules in " + addr; return resolver.doResolve( target, obj, message, resolveContext, callback ); } if (resolveContext.log) resolveContext.log( addr + " doesn't exist or is not a directory" ); if (resolveContext.missingDependencies) resolveContext.missingDependencies.add(addr); return callback(); }); }, callback ); } ); } }; /***/ }), /***/ 39803: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInRootPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} path path * @param {string | ResolveStepHook} target target */ constructor(source, path, target) { this.source = source; this.path = path; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { const obj = { ...request, path: this.path, request: "./" + request.request, module: false }; resolver.doResolve( target, obj, "looking for modules in " + this.path, resolveContext, callback ); }); } }; /***/ }), /***/ 76354: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class NextPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("NextPlugin", (request, resolveContext, callback) => { resolver.doResolve(target, request, null, resolveContext, callback); }); } }; /***/ }), /***/ 95204: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ParsePlugin { /** * @param {string | ResolveStepHook} source source * @param {Partial} requestOptions request options * @param {string | ResolveStepHook} target target */ constructor(source, requestOptions, target) { this.source = source; this.requestOptions = requestOptions; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("ParsePlugin", (request, resolveContext, callback) => { const parsed = resolver.parse(/** @type {string} */ (request.request)); const obj = { ...request, ...parsed, ...this.requestOptions }; if (request.query && !parsed.query) { obj.query = request.query; } if (request.fragment && !parsed.fragment) { obj.fragment = request.fragment; } if (parsed && resolveContext.log) { if (parsed.module) resolveContext.log("Parsed request is a module"); if (parsed.directory) resolveContext.log("Parsed request is a directory"); } // There is an edge-case where a request with # can be a path or a fragment -> try both if (obj.request && !obj.query && obj.fragment) { const directory = obj.fragment.endsWith("/"); const alternative = { ...obj, directory, request: obj.request + (obj.directory ? "/" : "") + (directory ? obj.fragment.slice(0, -1) : obj.fragment), fragment: "" }; resolver.doResolve( target, alternative, null, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); resolver.doResolve(target, obj, null, resolveContext, callback); } ); return; } resolver.doResolve(target, obj, null, resolveContext, callback); }); } }; /***/ }), /***/ 63321: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Maël Nison @arcanis */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** * @typedef {Object} PnpApiImpl * @property {function(string, string, object): string} resolveToUnqualified */ module.exports = class PnpPlugin { /** * @param {string | ResolveStepHook} source source * @param {PnpApiImpl} pnpApi pnpApi * @param {string | ResolveStepHook} target target */ constructor(source, pnpApi, target) { this.source = source; this.pnpApi = pnpApi; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("PnpPlugin", (request, resolveContext, callback) => { const req = request.request; if (!req) return callback(); // The trailing slash indicates to PnP that this value is a folder rather than a file const issuer = `${request.path}/`; const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); if (!packageMatch) return callback(); const packageName = packageMatch[0]; const innerRequest = `.${req.slice(packageName.length)}`; let resolution; let apiResolution; try { resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { considerBuiltins: false }); if (resolveContext.fileDependencies) { apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { considerBuiltins: false }); } } catch (error) { if ( error.code === "MODULE_NOT_FOUND" && error.pnpCode === "UNDECLARED_DEPENDENCY" ) { // This is not a PnP managed dependency. // Try to continue resolving with our alternatives if (resolveContext.log) { resolveContext.log(`request is not managed by the pnpapi`); for (const line of error.message.split("\n").filter(Boolean)) resolveContext.log(` ${line}`); } return callback(); } return callback(error); } if (resolution === packageName) return callback(); if (apiResolution && resolveContext.fileDependencies) { resolveContext.fileDependencies.add(apiResolution); } const obj = { ...request, path: resolution, request: innerRequest, ignoreSymlinks: true, fullySpecified: request.fullySpecified && innerRequest !== "." }; resolver.doResolve( target, obj, `resolved by pnp to ${resolution}`, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Skip alternatives return callback(null, null); } ); }); } }; /***/ }), /***/ 7675: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __webpack_require__(34718); const createInnerContext = __webpack_require__(710); const { parseIdentifier } = __webpack_require__(98623); const { normalize, cachedJoin: join, getType, PathType } = __webpack_require__(69821); /** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ /** * @typedef {Object} FileSystemStats * @property {function(): boolean} isDirectory * @property {function(): boolean} isFile */ /** * @typedef {Object} FileSystemDirent * @property {Buffer | string} name * @property {function(): boolean} isDirectory * @property {function(): boolean} isFile */ /** * @typedef {Object} PossibleFileSystemError * @property {string=} code * @property {number=} errno * @property {string=} path * @property {string=} syscall */ /** * @template T * @callback FileSystemCallback * @param {PossibleFileSystemError & Error | null | undefined} err * @param {T=} result */ /** * @typedef {Object} FileSystem * @property {(function(string | number, FileSystemCallback): void) & function(string | number, object, FileSystemCallback): void} readFile * @property {(function(string, string | number, FileSystemCallback): void) & function(string, string | number, string | number, FileSystemCallback): void=} open * @property {(function(number, FileSystemCallback): void) & function(number, object, FileSystemCallback): void=} fstat * @property {function(number, Buffer | Uint8Array, number, number, number, function(PossibleFileSystemError & Error | null | undefined, number=): void): void=} read * @property {function(number, function(PossibleFileSystemError & Error | null | undefined): void): void=} close * @property {(function(string, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void) & function(string, object, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void} readdir * @property {((function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void)=} readJson * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} readlink * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void=} lstat * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} stat */ /** * @typedef {Object} SyncFileSystem * @property {function(string | number, object=): Buffer | string} readFileSync * @property {function(string, string | number, string | number=): number=} openSync * @property {function(number, object=): FileSystemStats=} fstatSync * @property {function(number, Buffer | Uint8Array, number, number, number): number=} readSync * @property {function(number): void=} closeSync * @property {function(string, object=): (Buffer | string)[] | FileSystemDirent[]} readdirSync * @property {(function(string, object=): object)=} readJsonSync * @property {function(string, object=): Buffer | string} readlinkSync * @property {function(string, object=): FileSystemStats=} lstatSync * @property {function(string, object=): FileSystemStats} statSync */ /** * @typedef {Object} ParsedIdentifier * @property {string} request * @property {string} query * @property {string} fragment * @property {boolean} directory * @property {boolean} module * @property {boolean} file * @property {boolean} internal */ /** * @typedef {Object} BaseResolveRequest * @property {string | false} path * @property {string=} descriptionFilePath * @property {string=} descriptionFileRoot * @property {object=} descriptionFileData * @property {string=} relativePath * @property {boolean=} ignoreSymlinks * @property {boolean=} fullySpecified */ /** @typedef {BaseResolveRequest & Partial} ResolveRequest */ /** * String with special formatting * @typedef {string} StackEntry */ /** @template T @typedef {{ add: (T) => void }} WriteOnlySet */ /** * Resolve context * @typedef {Object} ResolveContext * @property {WriteOnlySet=} contextDependencies * @property {WriteOnlySet=} fileDependencies files that was found on file system * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system * @property {Set=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, * @property {(function(string): void)=} log log function */ /** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ /** * @param {string} str input string * @returns {string} in camel case */ function toCamelCase(str) { return str.replace(/-([a-z])/g, str => str.substr(1).toUpperCase()); } class Resolver { /** * @param {ResolveStepHook} hook hook * @param {ResolveRequest} request request * @returns {StackEntry} stack entry */ static createStackEntry(hook, request) { return ( hook.name + ": (" + request.path + ") " + (request.request || "") + (request.query || "") + (request.fragment || "") + (request.directory ? " directory" : "") + (request.module ? " module" : "") ); } /** * @param {FileSystem} fileSystem a filesystem * @param {ResolveOptions} options options */ constructor(fileSystem, options) { this.fileSystem = fileSystem; this.options = options; this.hooks = { /** @type {SyncHook<[ResolveStepHook, ResolveRequest], void>} */ resolveStep: new SyncHook(["hook", "request"], "resolveStep"), /** @type {SyncHook<[ResolveRequest, Error]>} */ noResolve: new SyncHook(["request", "error"], "noResolve"), /** @type {ResolveStepHook} */ resolve: new AsyncSeriesBailHook( ["request", "resolveContext"], "resolve" ), /** @type {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} */ result: new AsyncSeriesHook(["result", "resolveContext"], "result") }; } /** * @param {string | ResolveStepHook} name hook name or hook itself * @returns {ResolveStepHook} the hook */ ensureHook(name) { if (typeof name !== "string") { return name; } name = toCamelCase(name); if (/^before/.test(name)) { return /** @type {ResolveStepHook} */ (this.ensureHook( name[6].toLowerCase() + name.substr(7) ).withOptions({ stage: -10 })); } if (/^after/.test(name)) { return /** @type {ResolveStepHook} */ (this.ensureHook( name[5].toLowerCase() + name.substr(6) ).withOptions({ stage: 10 })); } const hook = this.hooks[name]; if (!hook) { return (this.hooks[name] = new AsyncSeriesBailHook( ["request", "resolveContext"], name )); } return hook; } /** * @param {string | ResolveStepHook} name hook name or hook itself * @returns {ResolveStepHook} the hook */ getHook(name) { if (typeof name !== "string") { return name; } name = toCamelCase(name); if (/^before/.test(name)) { return /** @type {ResolveStepHook} */ (this.getHook( name[6].toLowerCase() + name.substr(7) ).withOptions({ stage: -10 })); } if (/^after/.test(name)) { return /** @type {ResolveStepHook} */ (this.getHook( name[5].toLowerCase() + name.substr(6) ).withOptions({ stage: 10 })); } const hook = this.hooks[name]; if (!hook) { throw new Error(`Hook ${name} doesn't exist`); } return hook; } /** * @param {object} context context information object * @param {string} path context path * @param {string} request request string * @returns {string | false} result */ resolveSync(context, path, request) { /** @type {Error | null | undefined} */ let err = undefined; /** @type {string | false | undefined} */ let result = undefined; let sync = false; this.resolve(context, path, request, {}, (e, r) => { err = e; result = r; sync = true; }); if (!sync) { throw new Error( "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!" ); } if (err) throw err; if (result === undefined) throw new Error("No result"); return result; } /** * @param {object} context context information object * @param {string} path context path * @param {string} request request string * @param {ResolveContext} resolveContext resolve context * @param {function(Error | null, (string|false)=, ResolveRequest=): void} callback callback function * @returns {void} */ resolve(context, path, request, resolveContext, callback) { if (!context || typeof context !== "object") return callback(new Error("context argument is not an object")); if (typeof path !== "string") return callback(new Error("path argument is not a string")); if (typeof request !== "string") return callback(new Error("path argument is not a string")); if (!resolveContext) return callback(new Error("resolveContext argument is not set")); const obj = { context: context, path: path, request: request }; const message = `resolve '${request}' in '${path}'`; const finishResolved = result => { return callback( null, result.path === false ? false : `${result.path.replace(/#/g, "\0#")}${ result.query ? result.query.replace(/#/g, "\0#") : "" }${result.fragment || ""}`, result ); }; const finishWithoutResolve = log => { /** * @type {Error & {details?: string}} */ const error = new Error("Can't " + message); error.details = log.join("\n"); this.hooks.noResolve.call(obj, error); return callback(error); }; if (resolveContext.log) { // We need log anyway to capture it in case of an error const parentLog = resolveContext.log; const log = []; return this.doResolve( this.hooks.resolve, obj, message, { log: msg => { parentLog(msg); log.push(msg); }, fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, stack: resolveContext.stack }, (err, result) => { if (err) return callback(err); if (result) return finishResolved(result); return finishWithoutResolve(log); } ); } else { // Try to resolve assuming there is no error // We don't log stuff in this case return this.doResolve( this.hooks.resolve, obj, message, { log: undefined, fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, stack: resolveContext.stack }, (err, result) => { if (err) return callback(err); if (result) return finishResolved(result); // log is missing for the error details // so we redo the resolving for the log info // this is more expensive to the success case // is assumed by default const log = []; return this.doResolve( this.hooks.resolve, obj, message, { log: msg => log.push(msg), stack: resolveContext.stack }, (err, result) => { if (err) return callback(err); return finishWithoutResolve(log); } ); } ); } } doResolve(hook, request, message, resolveContext, callback) { const stackEntry = Resolver.createStackEntry(hook, request); let newStack; if (resolveContext.stack) { newStack = new Set(resolveContext.stack); if (resolveContext.stack.has(stackEntry)) { /** * Prevent recursion * @type {Error & {recursion?: boolean}} */ const recursionError = new Error( "Recursion in resolving\nStack:\n " + Array.from(newStack).join("\n ") ); recursionError.recursion = true; if (resolveContext.log) resolveContext.log("abort resolving because of recursion"); return callback(recursionError); } newStack.add(stackEntry); } else { newStack = new Set([stackEntry]); } this.hooks.resolveStep.call(hook, request); if (hook.isUsed()) { const innerContext = createInnerContext( { log: resolveContext.log, fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, stack: newStack }, message ); return hook.callAsync(request, innerContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); callback(); }); } else { callback(); } } /** * @param {string} identifier identifier * @returns {ParsedIdentifier} parsed identifier */ parse(identifier) { const part = { request: "", query: "", fragment: "", module: false, directory: false, file: false, internal: false }; const parsedIdentifier = parseIdentifier(identifier); if (!parsedIdentifier) return part; [part.request, part.query, part.fragment] = parsedIdentifier; if (part.request.length > 0) { part.internal = this.isPrivate(identifier); part.module = this.isModule(part.request); part.directory = this.isDirectory(part.request); if (part.directory) { part.request = part.request.substr(0, part.request.length - 1); } } return part; } isModule(path) { return getType(path) === PathType.Normal; } isPrivate(path) { return getType(path) === PathType.Internal; } /** * @param {string} path a path * @returns {boolean} true, if the path is a directory path */ isDirectory(path) { return path.endsWith("/"); } join(path, request) { return join(path, request); } normalize(path) { return normalize(path); } } module.exports = Resolver; /***/ }), /***/ 1453: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const versions = __webpack_require__(61765).versions; const Resolver = __webpack_require__(7675); const { getType, PathType } = __webpack_require__(69821); const SyncAsyncFileSystemDecorator = __webpack_require__(83908); const AliasFieldPlugin = __webpack_require__(94469); const AliasPlugin = __webpack_require__(42673); const AppendPlugin = __webpack_require__(72405); const ConditionalPlugin = __webpack_require__(13134); const DescriptionFilePlugin = __webpack_require__(85774); const DirectoryExistsPlugin = __webpack_require__(61827); const ExportsFieldPlugin = __webpack_require__(98169); const FileExistsPlugin = __webpack_require__(9412); const ImportsFieldPlugin = __webpack_require__(41031); const JoinRequestPartPlugin = __webpack_require__(11399); const JoinRequestPlugin = __webpack_require__(90522); const MainFieldPlugin = __webpack_require__(18425); const ModulesInHierachicDirectoriesPlugin = __webpack_require__(44964); const ModulesInRootPlugin = __webpack_require__(39803); const NextPlugin = __webpack_require__(76354); const ParsePlugin = __webpack_require__(95204); const PnpPlugin = __webpack_require__(63321); const RestrictionsPlugin = __webpack_require__(94620); const ResultPlugin = __webpack_require__(47775); const RootsPlugin = __webpack_require__(8068); const SelfReferencePlugin = __webpack_require__(24887); const SymlinkPlugin = __webpack_require__(69476); const TryNextPlugin = __webpack_require__(73771); const UnsafeCachePlugin = __webpack_require__(57943); const UseFilePlugin = __webpack_require__(81190); /** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** @typedef {string|string[]|false} AliasOptionNewRequest */ /** @typedef {{[k: string]: AliasOptionNewRequest}} AliasOptions */ /** @typedef {{apply: function(Resolver): void} | function(this: Resolver, Resolver): void} Plugin */ /** * @typedef {Object} UserResolveOptions * @property {(AliasOptions | AliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value * @property {(AliasOptions | AliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option * @property {(string | string[])[]=} aliasFields A list of alias fields in description files * @property {(function(ResolveRequest): boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. * @property {string[]=} descriptionFiles A list of description files to read from * @property {string[]=} conditionNames A list of exports field condition names. * @property {boolean=} enforceExtension Enforce that a extension from extensions must be used * @property {(string | string[])[]=} exportsFields A list of exports fields in description files * @property {(string | string[])[]=} importsFields A list of imports fields in description files * @property {string[]=} extensions A list of extensions which should be tried for files * @property {FileSystem} fileSystem The file system which should be used * @property {(object | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests * @property {boolean=} symlinks Resolve symlinks to their symlinked location * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached * @property {string[] | string=} modules A list of directories to resolve modules from, can be absolute path or folder name * @property {(string | string[] | {name: string | string[], forceRelative: boolean})[]=} mainFields A list of main fields in description files * @property {string[]=} mainFiles A list of main files in directories * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" * @property {string[]=} roots A list of root paths * @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it * @property {boolean=} resolveToContext Resolve to a context instead of a file * @property {(string|RegExp)[]=} restrictions A list of resolve restrictions * @property {boolean=} useSyncFileSystemCalls Use only the sync constiants of the file system calls * @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules * @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots */ /** * @typedef {Object} ResolveOptions * @property {AliasOptionEntry[]} alias * @property {AliasOptionEntry[]} fallback * @property {Set} aliasFields * @property {(function(ResolveRequest): boolean)} cachePredicate * @property {boolean} cacheWithContext * @property {Set} conditionNames A list of exports field condition names. * @property {string[]} descriptionFiles * @property {boolean} enforceExtension * @property {Set} exportsFields * @property {Set} importsFields * @property {Set} extensions * @property {FileSystem} fileSystem * @property {object | false} unsafeCache * @property {boolean} symlinks * @property {Resolver=} resolver * @property {Array} modules * @property {{name: string[], forceRelative: boolean}[]} mainFields * @property {Set} mainFiles * @property {Plugin[]} plugins * @property {PnpApi | null} pnpApi * @property {Set} roots * @property {boolean} fullySpecified * @property {boolean} resolveToContext * @property {Set} restrictions * @property {boolean} preferRelative * @property {boolean} preferAbsolute */ /** * @param {PnpApi | null=} option option * @returns {PnpApi | null} processed option */ function processPnpApiOption(option) { if ( option === undefined && /** @type {NodeJS.ProcessVersions & {pnp: string}} */ versions.pnp ) { // @ts-ignore return __webpack_require__(97289); // eslint-disable-line node/no-missing-require } return option || null; } /** * @param {AliasOptions | AliasOptionEntry[] | undefined} alias alias * @returns {AliasOptionEntry[]} normalized aliases */ function normalizeAlias(alias) { return typeof alias === "object" && !Array.isArray(alias) && alias !== null ? Object.keys(alias).map(key => { /** @type {AliasOptionEntry} */ const obj = { name: key, onlyModule: false, alias: alias[key] }; if (/\$$/.test(key)) { obj.onlyModule = true; obj.name = key.substr(0, key.length - 1); } return obj; }) : /** @type {Array} */ (alias) || []; } /** * @param {UserResolveOptions} options input options * @returns {ResolveOptions} output options */ function createOptions(options) { const mainFieldsSet = new Set(options.mainFields || ["main"]); const mainFields = []; for (const item of mainFieldsSet) { if (typeof item === "string") { mainFields.push({ name: [item], forceRelative: true }); } else if (Array.isArray(item)) { mainFields.push({ name: item, forceRelative: true }); } else { mainFields.push({ name: Array.isArray(item.name) ? item.name : [item.name], forceRelative: item.forceRelative }); } } return { alias: normalizeAlias(options.alias), fallback: normalizeAlias(options.fallback), aliasFields: new Set(options.aliasFields), cachePredicate: options.cachePredicate || function () { return true; }, cacheWithContext: typeof options.cacheWithContext !== "undefined" ? options.cacheWithContext : true, exportsFields: new Set(options.exportsFields || ["exports"]), importsFields: new Set(options.importsFields || ["imports"]), conditionNames: new Set(options.conditionNames), descriptionFiles: Array.from( new Set(options.descriptionFiles || ["package.json"]) ), enforceExtension: options.enforceExtension === undefined ? options.extensions && options.extensions.includes("") ? true : false : options.enforceExtension, extensions: new Set(options.extensions || [".js", ".json", ".node"]), fileSystem: options.useSyncFileSystemCalls ? new SyncAsyncFileSystemDecorator( /** @type {SyncFileSystem} */ ( /** @type {unknown} */ (options.fileSystem) ) ) : options.fileSystem, unsafeCache: options.unsafeCache && typeof options.unsafeCache !== "object" ? {} : options.unsafeCache || false, symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, resolver: options.resolver, modules: mergeFilteredToArray( Array.isArray(options.modules) ? options.modules : options.modules ? [options.modules] : ["node_modules"], item => { const type = getType(item); return type === PathType.Normal || type === PathType.Relative; } ), mainFields, mainFiles: new Set(options.mainFiles || ["index"]), plugins: options.plugins || [], pnpApi: processPnpApiOption(options.pnpApi), roots: new Set(options.roots || undefined), fullySpecified: options.fullySpecified || false, resolveToContext: options.resolveToContext || false, preferRelative: options.preferRelative || false, preferAbsolute: options.preferAbsolute || false, restrictions: new Set(options.restrictions) }; } /** * @param {UserResolveOptions} options resolve options * @returns {Resolver} created resolver */ exports.createResolver = function (options) { const normalizedOptions = createOptions(options); const { alias, fallback, aliasFields, cachePredicate, cacheWithContext, conditionNames, descriptionFiles, enforceExtension, exportsFields, importsFields, extensions, fileSystem, fullySpecified, mainFields, mainFiles, modules, plugins: userPlugins, pnpApi, resolveToContext, preferRelative, preferAbsolute, symlinks, unsafeCache, resolver: customResolver, restrictions, roots } = normalizedOptions; const plugins = userPlugins.slice(); const resolver = customResolver ? customResolver : new Resolver(fileSystem, normalizedOptions); //// pipeline //// resolver.ensureHook("resolve"); resolver.ensureHook("internalResolve"); resolver.ensureHook("newInteralResolve"); resolver.ensureHook("parsedResolve"); resolver.ensureHook("describedResolve"); resolver.ensureHook("internal"); resolver.ensureHook("rawModule"); resolver.ensureHook("module"); resolver.ensureHook("resolveAsModule"); resolver.ensureHook("undescribedResolveInPackage"); resolver.ensureHook("resolveInPackage"); resolver.ensureHook("resolveInExistingDirectory"); resolver.ensureHook("relative"); resolver.ensureHook("describedRelative"); resolver.ensureHook("directory"); resolver.ensureHook("undescribedExistingDirectory"); resolver.ensureHook("existingDirectory"); resolver.ensureHook("undescribedRawFile"); resolver.ensureHook("rawFile"); resolver.ensureHook("file"); resolver.ensureHook("finalFile"); resolver.ensureHook("existingFile"); resolver.ensureHook("resolved"); // resolve for (const { source, resolveOptions } of [ { source: "resolve", resolveOptions: { fullySpecified } }, { source: "internal-resolve", resolveOptions: { fullySpecified: false } } ]) { if (unsafeCache) { plugins.push( new UnsafeCachePlugin( source, cachePredicate, unsafeCache, cacheWithContext, `new-${source}` ) ); plugins.push( new ParsePlugin(`new-${source}`, resolveOptions, "parsed-resolve") ); } else { plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); } } // parsed-resolve plugins.push( new DescriptionFilePlugin( "parsed-resolve", descriptionFiles, false, "described-resolve" ) ); plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); // described-resolve plugins.push(new NextPlugin("described-resolve", "normal-resolve")); if (fallback.length > 0) { plugins.push( new AliasPlugin("described-resolve", fallback, "internal-resolve") ); } // normal-resolve if (alias.length > 0) plugins.push(new AliasPlugin("normal-resolve", alias, "internal-resolve")); aliasFields.forEach(item => { plugins.push( new AliasFieldPlugin("normal-resolve", item, "internal-resolve") ); }); if (preferRelative) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } plugins.push( new ConditionalPlugin( "after-normal-resolve", { module: true }, "resolve as module", false, "raw-module" ) ); plugins.push( new ConditionalPlugin( "after-normal-resolve", { internal: true }, "resolve as internal import", false, "internal" ) ); if (preferAbsolute) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } if (roots.size > 0) { plugins.push(new RootsPlugin("after-normal-resolve", roots, "relative")); } if (!preferRelative && !preferAbsolute) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } // internal importsFields.forEach(importsField => { plugins.push( new ImportsFieldPlugin( "internal", conditionNames, importsField, "relative", "internal-resolve" ) ); }); // raw-module exportsFields.forEach(exportsField => { plugins.push( new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module") ); }); modules.forEach(item => { if (Array.isArray(item)) { if (item.includes("node_modules") && pnpApi) { plugins.push( new ModulesInHierachicDirectoriesPlugin( "raw-module", item.filter(i => i !== "node_modules"), "module" ) ); plugins.push( new PnpPlugin("raw-module", pnpApi, "undescribed-resolve-in-package") ); } else { plugins.push( new ModulesInHierachicDirectoriesPlugin("raw-module", item, "module") ); } } else { plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); } }); // module plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); // resolve-as-module if (!resolveToContext) { plugins.push( new ConditionalPlugin( "resolve-as-module", { directory: false, request: "." }, "single file module", true, "undescribed-raw-file" ) ); } plugins.push( new DirectoryExistsPlugin( "resolve-as-module", "undescribed-resolve-in-package" ) ); // undescribed-resolve-in-package plugins.push( new DescriptionFilePlugin( "undescribed-resolve-in-package", descriptionFiles, false, "resolve-in-package" ) ); plugins.push( new NextPlugin("after-undescribed-resolve-in-package", "resolve-in-package") ); // resolve-in-package exportsFields.forEach(exportsField => { plugins.push( new ExportsFieldPlugin( "resolve-in-package", conditionNames, exportsField, "relative" ) ); }); plugins.push( new NextPlugin("resolve-in-package", "resolve-in-existing-directory") ); // resolve-in-existing-directory plugins.push( new JoinRequestPlugin("resolve-in-existing-directory", "relative") ); // relative plugins.push( new DescriptionFilePlugin( "relative", descriptionFiles, true, "described-relative" ) ); plugins.push(new NextPlugin("after-relative", "described-relative")); // described-relative if (resolveToContext) { plugins.push(new NextPlugin("described-relative", "directory")); } else { plugins.push( new ConditionalPlugin( "described-relative", { directory: false }, null, true, "raw-file" ) ); plugins.push( new ConditionalPlugin( "described-relative", { fullySpecified: false }, "as directory", true, "directory" ) ); } // directory plugins.push( new DirectoryExistsPlugin("directory", "undescribed-existing-directory") ); if (resolveToContext) { // undescribed-existing-directory plugins.push(new NextPlugin("undescribed-existing-directory", "resolved")); } else { // undescribed-existing-directory plugins.push( new DescriptionFilePlugin( "undescribed-existing-directory", descriptionFiles, false, "existing-directory" ) ); mainFiles.forEach(item => { plugins.push( new UseFilePlugin( "undescribed-existing-directory", item, "undescribed-raw-file" ) ); }); // described-existing-directory mainFields.forEach(item => { plugins.push( new MainFieldPlugin( "existing-directory", item, "resolve-in-existing-directory" ) ); }); mainFiles.forEach(item => { plugins.push( new UseFilePlugin("existing-directory", item, "undescribed-raw-file") ); }); // undescribed-raw-file plugins.push( new DescriptionFilePlugin( "undescribed-raw-file", descriptionFiles, true, "raw-file" ) ); plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); // raw-file plugins.push( new ConditionalPlugin( "raw-file", { fullySpecified: true }, null, false, "file" ) ); if (!enforceExtension) { plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); } extensions.forEach(item => { plugins.push(new AppendPlugin("raw-file", item, "file")); }); // file if (alias.length > 0) plugins.push(new AliasPlugin("file", alias, "internal-resolve")); aliasFields.forEach(item => { plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); }); plugins.push(new NextPlugin("file", "final-file")); // final-file plugins.push(new FileExistsPlugin("final-file", "existing-file")); // existing-file if (symlinks) plugins.push(new SymlinkPlugin("existing-file", "existing-file")); plugins.push(new NextPlugin("existing-file", "resolved")); } // resolved if (restrictions.size > 0) { plugins.push(new RestrictionsPlugin(resolver.hooks.resolved, restrictions)); } plugins.push(new ResultPlugin(resolver.hooks.resolved)); //// RESOLVER //// for (const plugin of plugins) { if (typeof plugin === "function") { plugin.call(resolver, resolver); } else { plugin.apply(resolver); } } return resolver; }; /** * Merging filtered elements * @param {string[]} array source array * @param {function(string): boolean} filter predicate * @returns {Array} merge result */ function mergeFilteredToArray(array, filter) { /** @type {Array} */ const result = []; const set = new Set(array); for (const item of set) { if (filter(item)) { const lastElement = result.length > 0 ? result[result.length - 1] : undefined; if (Array.isArray(lastElement)) { lastElement.push(item); } else { result.push([item]); } } else { result.push(item); } } return result; } /***/ }), /***/ 94620: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const slashCode = "/".charCodeAt(0); const backslashCode = "\\".charCodeAt(0); const isInside = (path, parent) => { if (!path.startsWith(parent)) return false; if (path.length === parent.length) return true; const charCode = path.charCodeAt(parent.length); return charCode === slashCode || charCode === backslashCode; }; module.exports = class RestrictionsPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} restrictions restrictions */ constructor(source, restrictions) { this.source = source; this.restrictions = restrictions; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { resolver .getHook(this.source) .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { if (typeof request.path === "string") { const path = request.path; for (const rule of this.restrictions) { if (typeof rule === "string") { if (!isInside(path, rule)) { if (resolveContext.log) { resolveContext.log( `${path} is not inside of the restriction ${rule}` ); } return callback(null, null); } } else if (!rule.test(path)) { if (resolveContext.log) { resolveContext.log( `${path} doesn't match the restriction ${rule}` ); } return callback(null, null); } } } callback(); }); } }; /***/ }), /***/ 47775: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ResultPlugin { /** * @param {ResolveStepHook} source source */ constructor(source) { this.source = source; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { this.source.tapAsync( "ResultPlugin", (request, resolverContext, callback) => { const obj = { ...request }; if (resolverContext.log) resolverContext.log("reporting result " + obj.path); resolver.hooks.result.callAsync(obj, resolverContext, err => { if (err) return callback(err); callback(null, obj); }); } ); } }; /***/ }), /***/ 8068: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ const forEachBail = __webpack_require__(55426); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ class RootsPlugin { /** * @param {string | ResolveStepHook} source source hook * @param {Set} roots roots * @param {string | ResolveStepHook} target target hook */ constructor(source, roots, target) { this.roots = Array.from(roots); this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("RootsPlugin", (request, resolveContext, callback) => { const req = request.request; if (!req) return callback(); if (!req.startsWith("/")) return callback(); forEachBail( this.roots, (root, callback) => { const path = resolver.join(root, req.slice(1)); const obj = { ...request, path, relativePath: request.relativePath && path }; resolver.doResolve( target, obj, `root path ${root}`, resolveContext, callback ); }, callback ); }); } } module.exports = RootsPlugin; /***/ }), /***/ 24887: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const DescriptionFileUtils = __webpack_require__(18641); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const slashCode = "/".charCodeAt(0); module.exports = class SelfReferencePlugin { /** * @param {string | ResolveStepHook} source source * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} target target */ constructor(source, fieldNamePath, target) { this.source = source; this.target = target; this.fieldName = fieldNamePath; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("SelfReferencePlugin", (request, resolveContext, callback) => { if (!request.descriptionFilePath) return callback(); const req = request.request; if (!req) return callback(); // Feature is only enabled when an exports field is present const exportsField = DescriptionFileUtils.getField( request.descriptionFileData, this.fieldName ); if (!exportsField) return callback(); const name = DescriptionFileUtils.getField( request.descriptionFileData, "name" ); if (typeof name !== "string") return callback(); if ( req.startsWith(name) && (req.length === name.length || req.charCodeAt(name.length) === slashCode) ) { const remainingRequest = `.${req.slice(name.length)}`; const obj = { ...request, request: remainingRequest, path: /** @type {string} */ (request.descriptionFileRoot), relativePath: "." }; resolver.doResolve( target, obj, "self reference", resolveContext, callback ); } else { return callback(); } }); } }; /***/ }), /***/ 69476: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const forEachBail = __webpack_require__(55426); const getPaths = __webpack_require__(17117); const { getType, PathType } = __webpack_require__(69821); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class SymlinkPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const fs = resolver.fileSystem; resolver .getHook(this.source) .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { if (request.ignoreSymlinks) return callback(); const pathsResult = getPaths(request.path); const pathSeqments = pathsResult.seqments; const paths = pathsResult.paths; let containsSymlink = false; let idx = -1; forEachBail( paths, (path, callback) => { idx++; if (resolveContext.fileDependencies) resolveContext.fileDependencies.add(path); fs.readlink(path, (err, result) => { if (!err && result) { pathSeqments[idx] = result; containsSymlink = true; // Shortcut when absolute symlink found const resultType = getType(result.toString()); if ( resultType === PathType.AbsoluteWin || resultType === PathType.AbsolutePosix ) { return callback(null, idx); } } callback(); }); }, (err, idx) => { if (!containsSymlink) return callback(); const resultSeqments = typeof idx === "number" ? pathSeqments.slice(0, idx + 1) : pathSeqments.slice(); const result = resultSeqments.reduceRight((a, b) => { return resolver.join(a, b); }); const obj = { ...request, path: result }; resolver.doResolve( target, obj, "resolved symlink to " + result, resolveContext, callback ); } ); }); } }; /***/ }), /***/ 83908: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** * @param {SyncFileSystem} fs file system implementation * @constructor */ function SyncAsyncFileSystemDecorator(fs) { this.fs = fs; this.lstat = undefined; this.lstatSync = undefined; const lstatSync = fs.lstatSync; if (lstatSync) { this.lstat = (arg, options, callback) => { let result; try { result = lstatSync.call(fs, arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.lstatSync = (arg, options) => lstatSync.call(fs, arg, options); } this.stat = (arg, options, callback) => { let result; try { result = callback ? fs.statSync(arg, options) : fs.statSync(arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.statSync = (arg, options) => fs.statSync(arg, options); this.readdir = (arg, options, callback) => { let result; try { result = fs.readdirSync(arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.readdirSync = (arg, options) => fs.readdirSync(arg, options); this.readFile = (arg, options, callback) => { let result; try { result = fs.readFileSync(arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.readFileSync = (arg, options) => fs.readFileSync(arg, options); this.readlink = (arg, options, callback) => { let result; try { result = fs.readlinkSync(arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.readlinkSync = (arg, options) => fs.readlinkSync(arg, options); this.readJson = undefined; this.readJsonSync = undefined; const readJsonSync = fs.readJsonSync; if (readJsonSync) { this.readJson = (arg, options, callback) => { let result; try { result = readJsonSync.call(fs, arg); } catch (e) { return (callback || options)(e); } (callback || options)(null, result); }; this.readJsonSync = (arg, options) => readJsonSync.call(fs, arg, options); } } module.exports = SyncAsyncFileSystemDecorator; /***/ }), /***/ 73771: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class TryNextPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} message message * @param {string | ResolveStepHook} target target */ constructor(source, message, target) { this.source = source; this.message = message; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { resolver.doResolve( target, request, this.message, resolveContext, callback ); }); } }; /***/ }), /***/ 57943: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {{[k: string]: any}} Cache */ function getCacheId(request, withContext) { return JSON.stringify({ context: withContext ? request.context : "", path: request.path, query: request.query, fragment: request.fragment, request: request.request }); } module.exports = class UnsafeCachePlugin { /** * @param {string | ResolveStepHook} source source * @param {function(ResolveRequest): boolean} filterPredicate filterPredicate * @param {Cache} cache cache * @param {boolean} withContext withContext * @param {string | ResolveStepHook} target target */ constructor(source, filterPredicate, cache, withContext, target) { this.source = source; this.filterPredicate = filterPredicate; this.withContext = withContext; this.cache = cache; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { if (!this.filterPredicate(request)) return callback(); const cacheId = getCacheId(request, this.withContext); const cacheEntry = this.cache[cacheId]; if (cacheEntry) { return callback(null, cacheEntry); } resolver.doResolve( target, request, null, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, (this.cache[cacheId] = result)); callback(); } ); }); } }; /***/ }), /***/ 81190: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class UseFilePlugin { /** * @param {string | ResolveStepHook} source source * @param {string} filename filename * @param {string | ResolveStepHook} target target */ constructor(source, filename, target) { this.source = source; this.filename = filename; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { const filePath = resolver.join(request.path, this.filename); const obj = { ...request, path: filePath, relativePath: request.relativePath && resolver.join(request.relativePath, this.filename) }; resolver.doResolve( target, obj, "using path: " + filePath, resolveContext, callback ); }); } }; /***/ }), /***/ 710: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function createInnerContext( options, message, messageOptional ) { let messageReported = false; let innerLog = undefined; if (options.log) { if (message) { innerLog = msg => { if (!messageReported) { options.log(message); messageReported = true; } options.log(" " + msg); }; } else { innerLog = options.log; } } const childContext = { log: innerLog, fileDependencies: options.fileDependencies, contextDependencies: options.contextDependencies, missingDependencies: options.missingDependencies, stack: options.stack }; return childContext; }; /***/ }), /***/ 55426: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function forEachBail(array, iterator, callback) { if (array.length === 0) return callback(); let i = 0; const next = () => { let loop = undefined; iterator(array[i++], (err, result) => { if (err || result !== undefined || i >= array.length) { return callback(err, result); } if (loop === false) while (next()); loop = true; }); if (!loop) loop = false; return loop; }; while (next()); }; /***/ }), /***/ 98361: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function getInnerRequest(resolver, request) { if ( typeof request.__innerRequest === "string" && request.__innerRequest_request === request.request && request.__innerRequest_relativePath === request.relativePath ) return request.__innerRequest; let innerRequest; if (request.request) { innerRequest = request.request; if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) { innerRequest = resolver.join(request.relativePath, innerRequest); } } else { innerRequest = request.relativePath; } request.__innerRequest_request = request.request; request.__innerRequest_relativePath = request.relativePath; return (request.__innerRequest = innerRequest); }; /***/ }), /***/ 17117: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function getPaths(path) { const parts = path.split(/(.*?[\\/]+)/); const paths = [path]; const seqments = [parts[parts.length - 1]]; let part = parts[parts.length - 1]; path = path.substr(0, path.length - part.length - 1); for (let i = parts.length - 2; i > 2; i -= 2) { paths.push(path); part = parts[i]; path = path.substr(0, path.length - part.length) || "/"; seqments.push(part.substr(0, part.length - 1)); } part = parts[1]; seqments.push(part); paths.push(part); return { paths: paths, seqments: seqments }; }; module.exports.basename = function basename(path) { const i = path.lastIndexOf("/"), j = path.lastIndexOf("\\"); const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; if (p < 0) return null; const s = path.substr(p + 1); return s; }; /***/ }), /***/ 27480: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const fs = __webpack_require__(82161); const CachedInputFileSystem = __webpack_require__(26785); const ResolverFactory = __webpack_require__(1453); /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./ResolverFactory").Plugin} Plugin */ /** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const nodeContext = { environments: ["node+es3+es5+process+native"] }; const asyncResolver = ResolverFactory.createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], fileSystem: nodeFileSystem }); function resolve(context, path, request, resolveContext, callback) { if (typeof context === "string") { callback = resolveContext; resolveContext = request; request = path; path = context; context = nodeContext; } if (typeof callback !== "function") { callback = resolveContext; } asyncResolver.resolve(context, path, request, resolveContext, callback); } const syncResolver = ResolverFactory.createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], useSyncFileSystemCalls: true, fileSystem: nodeFileSystem }); function resolveSync(context, path, request) { if (typeof context === "string") { request = path; path = context; context = nodeContext; } return syncResolver.resolveSync(context, path, request); } function create(options) { options = { fileSystem: nodeFileSystem, ...options }; const resolver = ResolverFactory.createResolver(options); return function (context, path, request, resolveContext, callback) { if (typeof context === "string") { callback = resolveContext; resolveContext = request; request = path; path = context; context = nodeContext; } if (typeof callback !== "function") { callback = resolveContext; } resolver.resolve(context, path, request, resolveContext, callback); }; } function createSync(options) { options = { useSyncFileSystemCalls: true, fileSystem: nodeFileSystem, ...options }; const resolver = ResolverFactory.createResolver(options); return function (context, path, request) { if (typeof context === "string") { request = path; path = context; context = nodeContext; } return resolver.resolveSync(context, path, request); }; } /** * @template A * @template B * @param {A} obj input a * @param {B} exports input b * @returns {A & B} merged */ const mergeExports = (obj, exports) => { const descriptors = Object.getOwnPropertyDescriptors(exports); Object.defineProperties(obj, descriptors); return /** @type {A & B} */ (Object.freeze(obj)); }; module.exports = mergeExports(resolve, { get sync() { return resolveSync; }, create: mergeExports(create, { get sync() { return createSync; } }), ResolverFactory, CachedInputFileSystem, get CloneBasenamePlugin() { return __webpack_require__(36154); }, get LogInfoPlugin() { return __webpack_require__(50098); }, get forEachBail() { return __webpack_require__(55426); } }); /***/ }), /***/ 94340: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ /** @typedef {string|(string|ConditionalMapping)[]} DirectMapping */ /** @typedef {{[k: string]: MappingValue}} ConditionalMapping */ /** @typedef {ConditionalMapping|DirectMapping|null} MappingValue */ /** @typedef {Record|ConditionalMapping|DirectMapping} ExportsField */ /** @typedef {Record} ImportsField */ /** * @typedef {Object} PathTreeNode * @property {Map|null} children * @property {MappingValue} folder * @property {Map|null} wildcards * @property {Map} files */ /** * Processing exports/imports field * @callback FieldProcessor * @param {string} request request * @param {Set} conditionNames condition names * @returns {string[]} resolved paths */ /* Example exports field: { ".": "./main.js", "./feature": { "browser": "./feature-browser.js", "default": "./feature.js" } } Terminology: Enhanced-resolve name keys ("." and "./feature") as exports field keys. If value is string or string[], mapping is called as a direct mapping and value called as a direct export. If value is key-value object, mapping is called as a conditional mapping and value called as a conditional export. Key in conditional mapping is called condition name. Conditional mapping nested in another conditional mapping is called nested mapping. ---------- Example imports field: { "#a": "./main.js", "#moment": { "browser": "./moment/index.js", "default": "moment" }, "#moment/": { "browser": "./moment/", "default": "moment/" } } Terminology: Enhanced-resolve name keys ("#a" and "#moment/", "#moment") as imports field keys. If value is string or string[], mapping is called as a direct mapping and value called as a direct export. If value is key-value object, mapping is called as a conditional mapping and value called as a conditional export. Key in conditional mapping is called condition name. Conditional mapping nested in another conditional mapping is called nested mapping. */ const slashCode = "/".charCodeAt(0); const dotCode = ".".charCodeAt(0); const hashCode = "#".charCodeAt(0); /** * @param {ExportsField} exportsField the exports field * @returns {FieldProcessor} process callback */ module.exports.processExportsField = function processExportsField( exportsField ) { return createFieldProcessor( buildExportsFieldPathTree(exportsField), assertExportsFieldRequest, assertExportTarget ); }; /** * @param {ImportsField} importsField the exports field * @returns {FieldProcessor} process callback */ module.exports.processImportsField = function processImportsField( importsField ) { return createFieldProcessor( buildImportsFieldPathTree(importsField), assertImportsFieldRequest, assertImportTarget ); }; /** * @param {PathTreeNode} treeRoot root * @param {(s: string) => string} assertRequest assertRequest * @param {(s: string, f: boolean) => void} assertTarget assertTarget * @returns {FieldProcessor} field processor */ function createFieldProcessor(treeRoot, assertRequest, assertTarget) { return function fieldProcessor(request, conditionNames) { request = assertRequest(request); const match = findMatch(request, treeRoot); if (match === null) return []; const [mapping, remainRequestIndex] = match; /** @type {DirectMapping|null} */ let direct = null; if (isConditionalMapping(mapping)) { direct = conditionalMapping( /** @type {ConditionalMapping} */ (mapping), conditionNames ); // matching not found if (direct === null) return []; } else { direct = /** @type {DirectMapping} */ (mapping); } const remainingRequest = remainRequestIndex === request.length + 1 ? undefined : remainRequestIndex < 0 ? request.slice(-remainRequestIndex - 1) : request.slice(remainRequestIndex); return directMapping( remainingRequest, remainRequestIndex < 0, direct, conditionNames, assertTarget ); }; } /** * @param {string} request request * @returns {string} updated request */ function assertExportsFieldRequest(request) { if (request.charCodeAt(0) !== dotCode) { throw new Error('Request should be relative path and start with "."'); } if (request.length === 1) return ""; if (request.charCodeAt(1) !== slashCode) { throw new Error('Request should be relative path and start with "./"'); } if (request.charCodeAt(request.length - 1) === slashCode) { throw new Error("Only requesting file allowed"); } return request.slice(2); } /** * @param {string} request request * @returns {string} updated request */ function assertImportsFieldRequest(request) { if (request.charCodeAt(0) !== hashCode) { throw new Error('Request should start with "#"'); } if (request.length === 1) { throw new Error("Request should have at least 2 characters"); } if (request.charCodeAt(1) === slashCode) { throw new Error('Request should not start with "#/"'); } if (request.charCodeAt(request.length - 1) === slashCode) { throw new Error("Only requesting file allowed"); } return request.slice(1); } /** * @param {string} exp export target * @param {boolean} expectFolder is folder expected */ function assertExportTarget(exp, expectFolder) { if ( exp.charCodeAt(0) === slashCode || (exp.charCodeAt(0) === dotCode && exp.charCodeAt(1) !== slashCode) ) { throw new Error( `Export should be relative path and start with "./", got ${JSON.stringify( exp )}.` ); } const isFolder = exp.charCodeAt(exp.length - 1) === slashCode; if (isFolder !== expectFolder) { throw new Error( expectFolder ? `Expecting folder to folder mapping. ${JSON.stringify( exp )} should end with "/"` : `Expecting file to file mapping. ${JSON.stringify( exp )} should not end with "/"` ); } } /** * @param {string} imp import target * @param {boolean} expectFolder is folder expected */ function assertImportTarget(imp, expectFolder) { const isFolder = imp.charCodeAt(imp.length - 1) === slashCode; if (isFolder !== expectFolder) { throw new Error( expectFolder ? `Expecting folder to folder mapping. ${JSON.stringify( imp )} should end with "/"` : `Expecting file to file mapping. ${JSON.stringify( imp )} should not end with "/"` ); } } /** * Trying to match request to field * @param {string} request request * @param {PathTreeNode} treeRoot path tree root * @returns {[MappingValue, number]|null} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings */ function findMatch(request, treeRoot) { if (request.length === 0) { const value = treeRoot.files.get(""); return value ? [value, 1] : null; } if ( treeRoot.children === null && treeRoot.folder === null && treeRoot.wildcards === null ) { const value = treeRoot.files.get(request); return value ? [value, request.length + 1] : null; } let node = treeRoot; let lastNonSlashIndex = 0; let slashIndex = request.indexOf("/", 0); /** @type {[MappingValue, number]|null} */ let lastFolderMatch = null; const applyFolderMapping = () => { const folderMapping = node.folder; if (folderMapping) { if (lastFolderMatch) { lastFolderMatch[0] = folderMapping; lastFolderMatch[1] = -lastNonSlashIndex - 1; } else { lastFolderMatch = [folderMapping, -lastNonSlashIndex - 1]; } } }; const applyWildcardMappings = (wildcardMappings, remainingRequest) => { if (wildcardMappings) { for (const [key, target] of wildcardMappings) { if (remainingRequest.startsWith(key)) { if (!lastFolderMatch) { lastFolderMatch = [target, lastNonSlashIndex + key.length]; } else if (lastFolderMatch[1] < lastNonSlashIndex + key.length) { lastFolderMatch[0] = target; lastFolderMatch[1] = lastNonSlashIndex + key.length; } } } } }; while (slashIndex !== -1) { applyFolderMapping(); const wildcardMappings = node.wildcards; if (!wildcardMappings && node.children === null) return lastFolderMatch; const folder = request.slice(lastNonSlashIndex, slashIndex); applyWildcardMappings(wildcardMappings, folder); if (node.children === null) return lastFolderMatch; const newNode = node.children.get(folder); if (!newNode) { return lastFolderMatch; } node = newNode; lastNonSlashIndex = slashIndex + 1; slashIndex = request.indexOf("/", lastNonSlashIndex); } const remainingRequest = lastNonSlashIndex > 0 ? request.slice(lastNonSlashIndex) : request; const value = node.files.get(remainingRequest); if (value) { return [value, request.length + 1]; } applyFolderMapping(); applyWildcardMappings(node.wildcards, remainingRequest); return lastFolderMatch; } /** * @param {ConditionalMapping|DirectMapping|null} mapping mapping * @returns {boolean} is conditional mapping */ function isConditionalMapping(mapping) { return ( mapping !== null && typeof mapping === "object" && !Array.isArray(mapping) ); } /** * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings * @param {boolean} subpathMapping true, for subpath mappings * @param {DirectMapping|null} mappingTarget direct export * @param {Set} conditionNames condition names * @param {(d: string, f: boolean) => void} assert asserting direct value * @returns {string[]} mapping result */ function directMapping( remainingRequest, subpathMapping, mappingTarget, conditionNames, assert ) { if (mappingTarget === null) return []; if (typeof mappingTarget === "string") { return [ targetMapping(remainingRequest, subpathMapping, mappingTarget, assert) ]; } const targets = []; for (const exp of mappingTarget) { if (typeof exp === "string") { targets.push( targetMapping(remainingRequest, subpathMapping, exp, assert) ); continue; } const mapping = conditionalMapping(exp, conditionNames); if (!mapping) continue; const innerExports = directMapping( remainingRequest, subpathMapping, mapping, conditionNames, assert ); for (const innerExport of innerExports) { targets.push(innerExport); } } return targets; } /** * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings * @param {boolean} subpathMapping true, for subpath mappings * @param {string} mappingTarget direct export * @param {(d: string, f: boolean) => void} assert asserting direct value * @returns {string} mapping result */ function targetMapping( remainingRequest, subpathMapping, mappingTarget, assert ) { if (remainingRequest === undefined) { assert(mappingTarget, false); return mappingTarget; } if (subpathMapping) { assert(mappingTarget, true); return mappingTarget + remainingRequest; } assert(mappingTarget, false); return mappingTarget.replace(/\*/g, remainingRequest.replace(/\$/g, "$$")); } /** * @param {ConditionalMapping} conditionalMapping_ conditional mapping * @param {Set} conditionNames condition names * @returns {DirectMapping|null} direct mapping if found */ function conditionalMapping(conditionalMapping_, conditionNames) { /** @type {[ConditionalMapping, string[], number][]} */ let lookup = [[conditionalMapping_, Object.keys(conditionalMapping_), 0]]; loop: while (lookup.length > 0) { const [mapping, conditions, j] = lookup[lookup.length - 1]; const last = conditions.length - 1; for (let i = j; i < conditions.length; i++) { const condition = conditions[i]; // assert default. Could be last only if (i !== last) { if (condition === "default") { throw new Error("Default condition should be last one"); } } else if (condition === "default") { const innerMapping = mapping[condition]; // is nested if (isConditionalMapping(innerMapping)) { const conditionalMapping = /** @type {ConditionalMapping} */ (innerMapping); lookup[lookup.length - 1][2] = i + 1; lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); continue loop; } return /** @type {DirectMapping} */ (innerMapping); } if (conditionNames.has(condition)) { const innerMapping = mapping[condition]; // is nested if (isConditionalMapping(innerMapping)) { const conditionalMapping = /** @type {ConditionalMapping} */ (innerMapping); lookup[lookup.length - 1][2] = i + 1; lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); continue loop; } return /** @type {DirectMapping} */ (innerMapping); } } lookup.pop(); } return null; } /** * Internal helper to create path tree node * to ensure that each node gets the same hidden class * @returns {PathTreeNode} node */ function createNode() { return { children: null, folder: null, wildcards: null, files: new Map() }; } /** * Internal helper for building path tree * @param {PathTreeNode} root root * @param {string} path path * @param {MappingValue} target target */ function walkPath(root, path, target) { if (path.length === 0) { root.folder = target; return; } let node = root; // Typical path tree can looks like // root // - files: ["a.js", "b.js"] // - children: // node1: // - files: ["a.js", "b.js"] let lastNonSlashIndex = 0; let slashIndex = path.indexOf("/", 0); while (slashIndex !== -1) { const folder = path.slice(lastNonSlashIndex, slashIndex); let newNode; if (node.children === null) { newNode = createNode(); node.children = new Map(); node.children.set(folder, newNode); } else { newNode = node.children.get(folder); if (!newNode) { newNode = createNode(); node.children.set(folder, newNode); } } node = newNode; lastNonSlashIndex = slashIndex + 1; slashIndex = path.indexOf("/", lastNonSlashIndex); } if (lastNonSlashIndex >= path.length) { node.folder = target; } else { const file = lastNonSlashIndex > 0 ? path.slice(lastNonSlashIndex) : path; if (file.endsWith("*")) { if (node.wildcards === null) node.wildcards = new Map(); node.wildcards.set(file.slice(0, -1), target); } else { node.files.set(file, target); } } } /** * @param {ExportsField} field exports field * @returns {PathTreeNode} tree root */ function buildExportsFieldPathTree(field) { const root = createNode(); // handle syntax sugar, if exports field is direct mapping for "." if (typeof field === "string") { root.files.set("", field); return root; } else if (Array.isArray(field)) { root.files.set("", field.slice()); return root; } const keys = Object.keys(field); for (let i = 0; i < keys.length; i++) { const key = keys[i]; if (key.charCodeAt(0) !== dotCode) { // handle syntax sugar, if exports field is conditional mapping for "." if (i === 0) { while (i < keys.length) { const charCode = keys[i].charCodeAt(0); if (charCode === dotCode || charCode === slashCode) { throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( key )})` ); } i++; } root.files.set("", field); return root; } throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( key )})` ); } if (key.length === 1) { root.files.set("", field[key]); continue; } if (key.charCodeAt(1) !== slashCode) { throw new Error( `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( key )})` ); } walkPath(root, key.slice(2), field[key]); } return root; } /** * @param {ImportsField} field imports field * @returns {PathTreeNode} root */ function buildImportsFieldPathTree(field) { const root = createNode(); const keys = Object.keys(field); for (let i = 0; i < keys.length; i++) { const key = keys[i]; if (key.charCodeAt(0) !== hashCode) { throw new Error( `Imports field key should start with "#" (key: ${JSON.stringify(key)})` ); } if (key.length === 1) { throw new Error( `Imports field key should have at least 2 characters (key: ${JSON.stringify( key )})` ); } if (key.charCodeAt(1) === slashCode) { throw new Error( `Imports field key should not start with "#/" (key: ${JSON.stringify( key )})` ); } walkPath(root, key.slice(1), field[key]); } return root; } /***/ }), /***/ 98623: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ const PATH_QUERY_FRAGMENT_REGEXP = /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; /** * @param {string} identifier identifier * @returns {[string, string, string]|null} parsed identifier */ function parseIdentifier(identifier) { const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier); if (!match) return null; return [ match[1].replace(/\0(.)/g, "$1"), match[2] ? match[2].replace(/\0(.)/g, "$1") : "", match[3] || "" ]; } module.exports.parseIdentifier = parseIdentifier; /***/ }), /***/ 69821: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const path = __webpack_require__(85622); const CHAR_HASH = "#".charCodeAt(0); const CHAR_SLASH = "/".charCodeAt(0); const CHAR_BACKSLASH = "\\".charCodeAt(0); const CHAR_A = "A".charCodeAt(0); const CHAR_Z = "Z".charCodeAt(0); const CHAR_LOWER_A = "a".charCodeAt(0); const CHAR_LOWER_Z = "z".charCodeAt(0); const CHAR_DOT = ".".charCodeAt(0); const CHAR_COLON = ":".charCodeAt(0); const posixNormalize = path.posix.normalize; const winNormalize = path.win32.normalize; /** * @enum {number} */ const PathType = Object.freeze({ Empty: 0, Normal: 1, Relative: 2, AbsoluteWin: 3, AbsolutePosix: 4, Internal: 5 }); exports.PathType = PathType; /** * @param {string} p a path * @returns {PathType} type of path */ const getType = p => { switch (p.length) { case 0: return PathType.Empty; case 1: { const c0 = p.charCodeAt(0); switch (c0) { case CHAR_DOT: return PathType.Relative; case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } return PathType.Normal; } case 2: { const c0 = p.charCodeAt(0); switch (c0) { case CHAR_DOT: { const c1 = p.charCodeAt(1); switch (c1) { case CHAR_DOT: case CHAR_SLASH: return PathType.Relative; } return PathType.Normal; } case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } const c1 = p.charCodeAt(1); if (c1 === CHAR_COLON) { if ( (c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z) ) { return PathType.AbsoluteWin; } } return PathType.Normal; } } const c0 = p.charCodeAt(0); switch (c0) { case CHAR_DOT: { const c1 = p.charCodeAt(1); switch (c1) { case CHAR_SLASH: return PathType.Relative; case CHAR_DOT: { const c2 = p.charCodeAt(2); if (c2 === CHAR_SLASH) return PathType.Relative; return PathType.Normal; } } return PathType.Normal; } case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } const c1 = p.charCodeAt(1); if (c1 === CHAR_COLON) { const c2 = p.charCodeAt(2); if ( (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && ((c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) ) { return PathType.AbsoluteWin; } } return PathType.Normal; }; exports.getType = getType; /** * @param {string} p a path * @returns {string} the normalized path */ const normalize = p => { switch (getType(p)) { case PathType.Empty: return p; case PathType.AbsoluteWin: return winNormalize(p); case PathType.Relative: { const r = posixNormalize(p); return getType(r) === PathType.Relative ? r : `./${r}`; } } return posixNormalize(p); }; exports.normalize = normalize; /** * @param {string} rootPath the root path * @param {string | undefined} request the request path * @returns {string} the joined path */ const join = (rootPath, request) => { if (!request) return normalize(rootPath); const requestType = getType(request); switch (requestType) { case PathType.AbsolutePosix: return posixNormalize(request); case PathType.AbsoluteWin: return winNormalize(request); } switch (getType(rootPath)) { case PathType.Normal: case PathType.Relative: case PathType.AbsolutePosix: return posixNormalize(`${rootPath}/${request}`); case PathType.AbsoluteWin: return winNormalize(`${rootPath}\\${request}`); } switch (requestType) { case PathType.Empty: return rootPath; case PathType.Relative: { const r = posixNormalize(rootPath); return getType(r) === PathType.Relative ? r : `./${r}`; } } return posixNormalize(rootPath); }; exports.join = join; const joinCache = new Map(); /** * @param {string} rootPath the root path * @param {string | undefined} request the request path * @returns {string} the joined path */ const cachedJoin = (rootPath, request) => { let cacheEntry; let cache = joinCache.get(rootPath); if (cache === undefined) { joinCache.set(rootPath, (cache = new Map())); } else { cacheEntry = cache.get(request); if (cacheEntry !== undefined) return cacheEntry; } cacheEntry = join(rootPath, request); cache.set(request, cacheEntry); return cacheEntry; }; exports.cachedJoin = cachedJoin; const checkExportsFieldTarget = relativePath => { let lastNonSlashIndex = 2; let slashIndex = relativePath.indexOf("/", 2); let cd = 0; while (slashIndex !== -1) { const folder = relativePath.slice(lastNonSlashIndex, slashIndex); switch (folder) { case "..": { cd--; if (cd < 0) return new Error( `Trying to access out of package scope. Requesting ${relativePath}` ); break; } default: cd++; break; } lastNonSlashIndex = slashIndex + 1; slashIndex = relativePath.indexOf("/", lastNonSlashIndex); } }; exports.checkExportsFieldTarget = checkExportsFieldTarget; /***/ }), /***/ 83798: /***/ (function(module) { "use strict"; class LoadingLoaderError extends Error { constructor(message) { super(message); this.name = "LoaderRunnerError"; Error.captureStackTrace(this, this.constructor); } } module.exports = LoadingLoaderError; /***/ }), /***/ 67578: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var fs = __webpack_require__(35747); var readFile = fs.readFile.bind(fs); var loadLoader = __webpack_require__(63395); function utf8BufferToString(buf) { var str = buf.toString("utf-8"); if(str.charCodeAt(0) === 0xFEFF) { return str.substr(1); } else { return str; } } const PATH_QUERY_FRAGMENT_REGEXP = /^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; /** * @param {string} str the path with query and fragment * @returns {{ path: string, query: string, fragment: string }} parsed parts */ function parsePathQueryFragment(str) { var match = PATH_QUERY_FRAGMENT_REGEXP.exec(str); return { path: match[1].replace(/\0(.)/g, "$1"), query: match[2] ? match[2].replace(/\0(.)/g, "$1") : "", fragment: match[3] || "" }; } function dirname(path) { if(path === "/") return "/"; var i = path.lastIndexOf("/"); var j = path.lastIndexOf("\\"); var i2 = path.indexOf("/"); var j2 = path.indexOf("\\"); var idx = i > j ? i : j; var idx2 = i > j ? i2 : j2; if(idx < 0) return path; if(idx === idx2) return path.substr(0, idx + 1); return path.substr(0, idx); } function createLoaderObject(loader) { var obj = { path: null, query: null, fragment: null, options: null, ident: null, normal: null, pitch: null, raw: null, data: null, pitchExecuted: false, normalExecuted: false }; Object.defineProperty(obj, "request", { enumerable: true, get: function() { return obj.path.replace(/#/g, "\0#") + obj.query.replace(/#/g, "\0#") + obj.fragment; }, set: function(value) { if(typeof value === "string") { var splittedRequest = parsePathQueryFragment(value); obj.path = splittedRequest.path; obj.query = splittedRequest.query; obj.fragment = splittedRequest.fragment; obj.options = undefined; obj.ident = undefined; } else { if(!value.loader) throw new Error("request should be a string or object with loader and options (" + JSON.stringify(value) + ")"); obj.path = value.loader; obj.fragment = value.fragment || ""; obj.type = value.type; obj.options = value.options; obj.ident = value.ident; if(obj.options === null) obj.query = ""; else if(obj.options === undefined) obj.query = ""; else if(typeof obj.options === "string") obj.query = "?" + obj.options; else if(obj.ident) obj.query = "??" + obj.ident; else if(typeof obj.options === "object" && obj.options.ident) obj.query = "??" + obj.options.ident; else obj.query = "?" + JSON.stringify(obj.options); } } }); obj.request = loader; if(Object.preventExtensions) { Object.preventExtensions(obj); } return obj; } function runSyncOrAsync(fn, context, args, callback) { var isSync = true; var isDone = false; var isError = false; // internal error var reportedError = false; context.async = function async() { if(isDone) { if(reportedError) return; // ignore throw new Error("async(): The callback was already called."); } isSync = false; return innerCallback; }; var innerCallback = context.callback = function() { if(isDone) { if(reportedError) return; // ignore throw new Error("callback(): The callback was already called."); } isDone = true; isSync = false; try { callback.apply(null, arguments); } catch(e) { isError = true; throw e; } }; try { var result = (function LOADER_EXECUTION() { return fn.apply(context, args); }()); if(isSync) { isDone = true; if(result === undefined) return callback(); if(result && typeof result === "object" && typeof result.then === "function") { return result.then(function(r) { callback(null, r); }, callback); } return callback(null, result); } } catch(e) { if(isError) throw e; if(isDone) { // loader is already "done", so we cannot use the callback function // for better debugging we print the error on the console if(typeof e === "object" && e.stack) console.error(e.stack); else console.error(e); return; } isDone = true; reportedError = true; callback(e); } } function convertArgs(args, raw) { if(!raw && Buffer.isBuffer(args[0])) args[0] = utf8BufferToString(args[0]); else if(raw && typeof args[0] === "string") args[0] = Buffer.from(args[0], "utf-8"); } function iteratePitchingLoaders(options, loaderContext, callback) { // abort after last loader if(loaderContext.loaderIndex >= loaderContext.loaders.length) return processResource(options, loaderContext, callback); var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; // iterate if(currentLoaderObject.pitchExecuted) { loaderContext.loaderIndex++; return iteratePitchingLoaders(options, loaderContext, callback); } // load loader module loadLoader(currentLoaderObject, function(err) { if(err) { loaderContext.cacheable(false); return callback(err); } var fn = currentLoaderObject.pitch; currentLoaderObject.pitchExecuted = true; if(!fn) return iteratePitchingLoaders(options, loaderContext, callback); runSyncOrAsync( fn, loaderContext, [loaderContext.remainingRequest, loaderContext.previousRequest, currentLoaderObject.data = {}], function(err) { if(err) return callback(err); var args = Array.prototype.slice.call(arguments, 1); // Determine whether to continue the pitching process based on // argument values (as opposed to argument presence) in order // to support synchronous and asynchronous usages. var hasArg = args.some(function(value) { return value !== undefined; }); if(hasArg) { loaderContext.loaderIndex--; iterateNormalLoaders(options, loaderContext, args, callback); } else { iteratePitchingLoaders(options, loaderContext, callback); } } ); }); } function processResource(options, loaderContext, callback) { // set loader index to last loader loaderContext.loaderIndex = loaderContext.loaders.length - 1; var resourcePath = loaderContext.resourcePath; if(resourcePath) { options.processResource(loaderContext, resourcePath, function(err, buffer) { if(err) return callback(err); options.resourceBuffer = buffer; iterateNormalLoaders(options, loaderContext, [buffer], callback); }); } else { iterateNormalLoaders(options, loaderContext, [null], callback); } } function iterateNormalLoaders(options, loaderContext, args, callback) { if(loaderContext.loaderIndex < 0) return callback(null, args); var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; // iterate if(currentLoaderObject.normalExecuted) { loaderContext.loaderIndex--; return iterateNormalLoaders(options, loaderContext, args, callback); } var fn = currentLoaderObject.normal; currentLoaderObject.normalExecuted = true; if(!fn) { return iterateNormalLoaders(options, loaderContext, args, callback); } convertArgs(args, currentLoaderObject.raw); runSyncOrAsync(fn, loaderContext, args, function(err) { if(err) return callback(err); var args = Array.prototype.slice.call(arguments, 1); iterateNormalLoaders(options, loaderContext, args, callback); }); } exports.getContext = function getContext(resource) { var path = parsePathQueryFragment(resource).path; return dirname(path); }; exports.runLoaders = function runLoaders(options, callback) { // read options var resource = options.resource || ""; var loaders = options.loaders || []; var loaderContext = options.context || {}; var processResource = options.processResource || ((readResource, context, resource, callback) => { context.addDependency(resource); readResource(resource, callback); }).bind(null, options.readResource || readFile); // var splittedResource = resource && parsePathQueryFragment(resource); var resourcePath = splittedResource ? splittedResource.path : undefined; var resourceQuery = splittedResource ? splittedResource.query : undefined; var resourceFragment = splittedResource ? splittedResource.fragment : undefined; var contextDirectory = resourcePath ? dirname(resourcePath) : null; // execution state var requestCacheable = true; var fileDependencies = []; var contextDependencies = []; var missingDependencies = []; // prepare loader objects loaders = loaders.map(createLoaderObject); loaderContext.context = contextDirectory; loaderContext.loaderIndex = 0; loaderContext.loaders = loaders; loaderContext.resourcePath = resourcePath; loaderContext.resourceQuery = resourceQuery; loaderContext.resourceFragment = resourceFragment; loaderContext.async = null; loaderContext.callback = null; loaderContext.cacheable = function cacheable(flag) { if(flag === false) { requestCacheable = false; } }; loaderContext.dependency = loaderContext.addDependency = function addDependency(file) { fileDependencies.push(file); }; loaderContext.addContextDependency = function addContextDependency(context) { contextDependencies.push(context); }; loaderContext.addMissingDependency = function addMissingDependency(context) { missingDependencies.push(context); }; loaderContext.getDependencies = function getDependencies() { return fileDependencies.slice(); }; loaderContext.getContextDependencies = function getContextDependencies() { return contextDependencies.slice(); }; loaderContext.getMissingDependencies = function getMissingDependencies() { return missingDependencies.slice(); }; loaderContext.clearDependencies = function clearDependencies() { fileDependencies.length = 0; contextDependencies.length = 0; missingDependencies.length = 0; requestCacheable = true; }; Object.defineProperty(loaderContext, "resource", { enumerable: true, get: function() { if(loaderContext.resourcePath === undefined) return undefined; return loaderContext.resourcePath.replace(/#/g, "\0#") + loaderContext.resourceQuery.replace(/#/g, "\0#") + loaderContext.resourceFragment; }, set: function(value) { var splittedResource = value && parsePathQueryFragment(value); loaderContext.resourcePath = splittedResource ? splittedResource.path : undefined; loaderContext.resourceQuery = splittedResource ? splittedResource.query : undefined; loaderContext.resourceFragment = splittedResource ? splittedResource.fragment : undefined; } }); Object.defineProperty(loaderContext, "request", { enumerable: true, get: function() { return loaderContext.loaders.map(function(o) { return o.request; }).concat(loaderContext.resource || "").join("!"); } }); Object.defineProperty(loaderContext, "remainingRequest", { enumerable: true, get: function() { if(loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource) return ""; return loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map(function(o) { return o.request; }).concat(loaderContext.resource || "").join("!"); } }); Object.defineProperty(loaderContext, "currentRequest", { enumerable: true, get: function() { return loaderContext.loaders.slice(loaderContext.loaderIndex).map(function(o) { return o.request; }).concat(loaderContext.resource || "").join("!"); } }); Object.defineProperty(loaderContext, "previousRequest", { enumerable: true, get: function() { return loaderContext.loaders.slice(0, loaderContext.loaderIndex).map(function(o) { return o.request; }).join("!"); } }); Object.defineProperty(loaderContext, "query", { enumerable: true, get: function() { var entry = loaderContext.loaders[loaderContext.loaderIndex]; return entry.options && typeof entry.options === "object" ? entry.options : entry.query; } }); Object.defineProperty(loaderContext, "data", { enumerable: true, get: function() { return loaderContext.loaders[loaderContext.loaderIndex].data; } }); // finish loader context if(Object.preventExtensions) { Object.preventExtensions(loaderContext); } var processOptions = { resourceBuffer: null, processResource: processResource }; iteratePitchingLoaders(processOptions, loaderContext, function(err, result) { if(err) { return callback(err, { cacheable: requestCacheable, fileDependencies: fileDependencies, contextDependencies: contextDependencies, missingDependencies: missingDependencies }); } callback(null, { result: result, resourceBuffer: processOptions.resourceBuffer, cacheable: requestCacheable, fileDependencies: fileDependencies, contextDependencies: contextDependencies, missingDependencies: missingDependencies }); }); }; /***/ }), /***/ 63395: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var LoaderLoadingError = __webpack_require__(83798); var url; module.exports = function loadLoader(loader, callback) { if(loader.type === "module") { try { if(url === undefined) url = __webpack_require__(78835); var loaderUrl = url.pathToFileURL(loader.path); var modulePromise = eval("import(" + JSON.stringify(loaderUrl.toString()) + ")"); modulePromise.then(function(module) { handleResult(loader, module, callback); }, callback); return; } catch(e) { callback(e); } } else { try { var module = require(loader.path); } catch(e) { // it is possible for node to choke on a require if the FD descriptor // limit has been reached. give it a chance to recover. if(e instanceof Error && e.code === "EMFILE") { var retry = loadLoader.bind(null, loader, callback); if(typeof setImmediate === "function") { // node >= 0.9.0 return setImmediate(retry); } else { // node < 0.9.0 return process.nextTick(retry); } } return callback(e); } return handleResult(loader, module, callback); } }; function handleResult(loader, module, callback) { if(typeof module !== "function" && typeof module !== "object") { return callback(new LoaderLoadingError( "Module '" + loader.path + "' is not a loader (export function or es6 module)" )); } loader.normal = typeof module === "function" ? module : module.default; loader.pitch = module.pitch; loader.raw = module.raw; if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") { return callback(new LoaderLoadingError( "Module '" + loader.path + "' is not a loader (must have normal or pitch function)" )); } callback(); } /***/ }), /***/ 11060: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(53243) /***/ }), /***/ 19338: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(11060) var extname = __webpack_require__(85622).extname /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } /***/ }), /***/ 28339: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncParallelBailHookCodeFactory extends HookCodeFactory { content({ onError, onResult, onDone }) { let code = ""; code += `var _results = new Array(${this.options.taps.length});\n`; code += "var _checkDone = function() {\n"; code += "for(var i = 0; i < _results.length; i++) {\n"; code += "var item = _results[i];\n"; code += "if(item === undefined) return false;\n"; code += "if(item.result !== undefined) {\n"; code += onResult("item.result"); code += "return true;\n"; code += "}\n"; code += "if(item.error) {\n"; code += onError("item.error"); code += "return true;\n"; code += "}\n"; code += "}\n"; code += "return false;\n"; code += "}\n"; code += this.callTapsParallel({ onError: (i, err, done, doneBreak) => { let code = ""; code += `if(${i} < _results.length && ((_results.length = ${i + 1}), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`; code += doneBreak(true); code += "} else {\n"; code += done(); code += "}\n"; return code; }, onResult: (i, result, done, doneBreak) => { let code = ""; code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${i + 1}), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`; code += doneBreak(true); code += "} else {\n"; code += done(); code += "}\n"; return code; }, onTap: (i, run, done, doneBreak) => { let code = ""; if (i > 0) { code += `if(${i} >= _results.length) {\n`; code += done(); code += "} else {\n"; } code += run(); if (i > 0) code += "}\n"; return code; }, onDone }); return code; } } const factory = new AsyncParallelBailHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncParallelBailHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = AsyncParallelBailHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncParallelBailHook.prototype = null; module.exports = AsyncParallelBailHook; /***/ }), /***/ 82890: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncParallelHookCodeFactory extends HookCodeFactory { content({ onError, onDone }) { return this.callTapsParallel({ onError: (i, err, done, doneBreak) => onError(err) + doneBreak(true), onDone }); } } const factory = new AsyncParallelHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncParallelHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = AsyncParallelHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncParallelHook.prototype = null; module.exports = AsyncParallelHook; /***/ }), /***/ 97681: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncSeriesBailHookCodeFactory extends HookCodeFactory { content({ onError, onResult, resultReturns, onDone }) { return this.callTapsSeries({ onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), onResult: (i, result, next) => `if(${result} !== undefined) {\n${onResult( result )}\n} else {\n${next()}}\n`, resultReturns, onDone }); } } const factory = new AsyncSeriesBailHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncSeriesBailHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = AsyncSeriesBailHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncSeriesBailHook.prototype = null; module.exports = AsyncSeriesBailHook; /***/ }), /***/ 45146: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncSeriesHookCodeFactory extends HookCodeFactory { content({ onError, onDone }) { return this.callTapsSeries({ onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), onDone }); } } const factory = new AsyncSeriesHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncSeriesHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = AsyncSeriesHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncSeriesHook.prototype = null; module.exports = AsyncSeriesHook; /***/ }), /***/ 5463: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncSeriesLoopHookCodeFactory extends HookCodeFactory { content({ onError, onDone }) { return this.callTapsLooping({ onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), onDone }); } } const factory = new AsyncSeriesLoopHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncSeriesLoopHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = AsyncSeriesLoopHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncSeriesLoopHook.prototype = null; module.exports = AsyncSeriesLoopHook; /***/ }), /***/ 73448: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class AsyncSeriesWaterfallHookCodeFactory extends HookCodeFactory { content({ onError, onResult, onDone }) { return this.callTapsSeries({ onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true), onResult: (i, result, next) => { let code = ""; code += `if(${result} !== undefined) {\n`; code += `${this._args[0]} = ${result};\n`; code += `}\n`; code += next(); return code; }, onDone: () => onResult(this._args[0]) }); } } const factory = new AsyncSeriesWaterfallHookCodeFactory(); const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function AsyncSeriesWaterfallHook(args = [], name = undefined) { if (args.length < 1) throw new Error("Waterfall hooks must have at least one argument"); const hook = new Hook(args, name); hook.constructor = AsyncSeriesWaterfallHook; hook.compile = COMPILE; hook._call = undefined; hook.call = undefined; return hook; } AsyncSeriesWaterfallHook.prototype = null; module.exports = AsyncSeriesWaterfallHook; /***/ }), /***/ 36591: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const util = __webpack_require__(31669); const deprecateContext = util.deprecate(() => {}, "Hook.context is deprecated and will be removed"); const CALL_DELEGATE = function(...args) { this.call = this._createCall("sync"); return this.call(...args); }; const CALL_ASYNC_DELEGATE = function(...args) { this.callAsync = this._createCall("async"); return this.callAsync(...args); }; const PROMISE_DELEGATE = function(...args) { this.promise = this._createCall("promise"); return this.promise(...args); }; class Hook { constructor(args = [], name = undefined) { this._args = args; this.name = name; this.taps = []; this.interceptors = []; this._call = CALL_DELEGATE; this.call = CALL_DELEGATE; this._callAsync = CALL_ASYNC_DELEGATE; this.callAsync = CALL_ASYNC_DELEGATE; this._promise = PROMISE_DELEGATE; this.promise = PROMISE_DELEGATE; this._x = undefined; this.compile = this.compile; this.tap = this.tap; this.tapAsync = this.tapAsync; this.tapPromise = this.tapPromise; } compile(options) { throw new Error("Abstract: should be overridden"); } _createCall(type) { return this.compile({ taps: this.taps, interceptors: this.interceptors, args: this._args, type: type }); } _tap(type, options, fn) { if (typeof options === "string") { options = { name: options.trim() }; } else if (typeof options !== "object" || options === null) { throw new Error("Invalid tap options"); } if (typeof options.name !== "string" || options.name === "") { throw new Error("Missing name for tap"); } if (typeof options.context !== "undefined") { deprecateContext(); } options = Object.assign({ type, fn }, options); options = this._runRegisterInterceptors(options); this._insert(options); } tap(options, fn) { this._tap("sync", options, fn); } tapAsync(options, fn) { this._tap("async", options, fn); } tapPromise(options, fn) { this._tap("promise", options, fn); } _runRegisterInterceptors(options) { for (const interceptor of this.interceptors) { if (interceptor.register) { const newOptions = interceptor.register(options); if (newOptions !== undefined) { options = newOptions; } } } return options; } withOptions(options) { const mergeOptions = opt => Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt); return { name: this.name, tap: (opt, fn) => this.tap(mergeOptions(opt), fn), tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn), tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn), intercept: interceptor => this.intercept(interceptor), isUsed: () => this.isUsed(), withOptions: opt => this.withOptions(mergeOptions(opt)) }; } isUsed() { return this.taps.length > 0 || this.interceptors.length > 0; } intercept(interceptor) { this._resetCompilation(); this.interceptors.push(Object.assign({}, interceptor)); if (interceptor.register) { for (let i = 0; i < this.taps.length; i++) { this.taps[i] = interceptor.register(this.taps[i]); } } } _resetCompilation() { this.call = this._call; this.callAsync = this._callAsync; this.promise = this._promise; } _insert(item) { this._resetCompilation(); let before; if (typeof item.before === "string") { before = new Set([item.before]); } else if (Array.isArray(item.before)) { before = new Set(item.before); } let stage = 0; if (typeof item.stage === "number") { stage = item.stage; } let i = this.taps.length; while (i > 0) { i--; const x = this.taps[i]; this.taps[i + 1] = x; const xStage = x.stage || 0; if (before) { if (before.has(x.name)) { before.delete(x.name); continue; } if (before.size > 0) { continue; } } if (xStage > stage) { continue; } i++; break; } this.taps[i] = item; } } Object.setPrototypeOf(Hook.prototype, null); module.exports = Hook; /***/ }), /***/ 85572: /***/ (function(module) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ class HookCodeFactory { constructor(config) { this.config = config; this.options = undefined; this._args = undefined; } create(options) { this.init(options); let fn; switch (this.options.type) { case "sync": fn = new Function( this.args(), '"use strict";\n' + this.header() + this.contentWithInterceptors({ onError: err => `throw ${err};\n`, onResult: result => `return ${result};\n`, resultReturns: true, onDone: () => "", rethrowIfPossible: true }) ); break; case "async": fn = new Function( this.args({ after: "_callback" }), '"use strict";\n' + this.header() + this.contentWithInterceptors({ onError: err => `_callback(${err});\n`, onResult: result => `_callback(null, ${result});\n`, onDone: () => "_callback();\n" }) ); break; case "promise": let errorHelperUsed = false; const content = this.contentWithInterceptors({ onError: err => { errorHelperUsed = true; return `_error(${err});\n`; }, onResult: result => `_resolve(${result});\n`, onDone: () => "_resolve();\n" }); let code = ""; code += '"use strict";\n'; code += this.header(); code += "return new Promise((function(_resolve, _reject) {\n"; if (errorHelperUsed) { code += "var _sync = true;\n"; code += "function _error(_err) {\n"; code += "if(_sync)\n"; code += "_resolve(Promise.resolve().then((function() { throw _err; })));\n"; code += "else\n"; code += "_reject(_err);\n"; code += "};\n"; } code += content; if (errorHelperUsed) { code += "_sync = false;\n"; } code += "}));\n"; fn = new Function(this.args(), code); break; } this.deinit(); return fn; } setup(instance, options) { instance._x = options.taps.map(t => t.fn); } /** * @param {{ type: "sync" | "promise" | "async", taps: Array, interceptors: Array }} options */ init(options) { this.options = options; this._args = options.args.slice(); } deinit() { this.options = undefined; this._args = undefined; } contentWithInterceptors(options) { if (this.options.interceptors.length > 0) { const onError = options.onError; const onResult = options.onResult; const onDone = options.onDone; let code = ""; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.call) { code += `${this.getInterceptor(i)}.call(${this.args({ before: interceptor.context ? "_context" : undefined })});\n`; } } code += this.content( Object.assign(options, { onError: onError && (err => { let code = ""; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.error) { code += `${this.getInterceptor(i)}.error(${err});\n`; } } code += onError(err); return code; }), onResult: onResult && (result => { let code = ""; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.result) { code += `${this.getInterceptor(i)}.result(${result});\n`; } } code += onResult(result); return code; }), onDone: onDone && (() => { let code = ""; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.done) { code += `${this.getInterceptor(i)}.done();\n`; } } code += onDone(); return code; }) }) ); return code; } else { return this.content(options); } } header() { let code = ""; if (this.needContext()) { code += "var _context = {};\n"; } else { code += "var _context;\n"; } code += "var _x = this._x;\n"; if (this.options.interceptors.length > 0) { code += "var _taps = this.taps;\n"; code += "var _interceptors = this.interceptors;\n"; } return code; } needContext() { for (const tap of this.options.taps) if (tap.context) return true; return false; } callTap(tapIndex, { onError, onResult, onDone, rethrowIfPossible }) { let code = ""; let hasTapCached = false; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.tap) { if (!hasTapCached) { code += `var _tap${tapIndex} = ${this.getTap(tapIndex)};\n`; hasTapCached = true; } code += `${this.getInterceptor(i)}.tap(${ interceptor.context ? "_context, " : "" }_tap${tapIndex});\n`; } } code += `var _fn${tapIndex} = ${this.getTapFn(tapIndex)};\n`; const tap = this.options.taps[tapIndex]; switch (tap.type) { case "sync": if (!rethrowIfPossible) { code += `var _hasError${tapIndex} = false;\n`; code += "try {\n"; } if (onResult) { code += `var _result${tapIndex} = _fn${tapIndex}(${this.args({ before: tap.context ? "_context" : undefined })});\n`; } else { code += `_fn${tapIndex}(${this.args({ before: tap.context ? "_context" : undefined })});\n`; } if (!rethrowIfPossible) { code += "} catch(_err) {\n"; code += `_hasError${tapIndex} = true;\n`; code += onError("_err"); code += "}\n"; code += `if(!_hasError${tapIndex}) {\n`; } if (onResult) { code += onResult(`_result${tapIndex}`); } if (onDone) { code += onDone(); } if (!rethrowIfPossible) { code += "}\n"; } break; case "async": let cbCode = ""; if (onResult) cbCode += `(function(_err${tapIndex}, _result${tapIndex}) {\n`; else cbCode += `(function(_err${tapIndex}) {\n`; cbCode += `if(_err${tapIndex}) {\n`; cbCode += onError(`_err${tapIndex}`); cbCode += "} else {\n"; if (onResult) { cbCode += onResult(`_result${tapIndex}`); } if (onDone) { cbCode += onDone(); } cbCode += "}\n"; cbCode += "})"; code += `_fn${tapIndex}(${this.args({ before: tap.context ? "_context" : undefined, after: cbCode })});\n`; break; case "promise": code += `var _hasResult${tapIndex} = false;\n`; code += `var _promise${tapIndex} = _fn${tapIndex}(${this.args({ before: tap.context ? "_context" : undefined })});\n`; code += `if (!_promise${tapIndex} || !_promise${tapIndex}.then)\n`; code += ` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${tapIndex} + ')');\n`; code += `_promise${tapIndex}.then((function(_result${tapIndex}) {\n`; code += `_hasResult${tapIndex} = true;\n`; if (onResult) { code += onResult(`_result${tapIndex}`); } if (onDone) { code += onDone(); } code += `}), function(_err${tapIndex}) {\n`; code += `if(_hasResult${tapIndex}) throw _err${tapIndex};\n`; code += onError(`_err${tapIndex}`); code += "});\n"; break; } return code; } callTapsSeries({ onError, onResult, resultReturns, onDone, doneReturns, rethrowIfPossible }) { if (this.options.taps.length === 0) return onDone(); const firstAsync = this.options.taps.findIndex(t => t.type !== "sync"); const somethingReturns = resultReturns || doneReturns; let code = ""; let current = onDone; let unrollCounter = 0; for (let j = this.options.taps.length - 1; j >= 0; j--) { const i = j; const unroll = current !== onDone && (this.options.taps[i].type !== "sync" || unrollCounter++ > 20); if (unroll) { unrollCounter = 0; code += `function _next${i}() {\n`; code += current(); code += `}\n`; current = () => `${somethingReturns ? "return " : ""}_next${i}();\n`; } const done = current; const doneBreak = skipDone => { if (skipDone) return ""; return onDone(); }; const content = this.callTap(i, { onError: error => onError(i, error, done, doneBreak), onResult: onResult && (result => { return onResult(i, result, done, doneBreak); }), onDone: !onResult && done, rethrowIfPossible: rethrowIfPossible && (firstAsync < 0 || i < firstAsync) }); current = () => content; } code += current(); return code; } callTapsLooping({ onError, onDone, rethrowIfPossible }) { if (this.options.taps.length === 0) return onDone(); const syncOnly = this.options.taps.every(t => t.type === "sync"); let code = ""; if (!syncOnly) { code += "var _looper = (function() {\n"; code += "var _loopAsync = false;\n"; } code += "var _loop;\n"; code += "do {\n"; code += "_loop = false;\n"; for (let i = 0; i < this.options.interceptors.length; i++) { const interceptor = this.options.interceptors[i]; if (interceptor.loop) { code += `${this.getInterceptor(i)}.loop(${this.args({ before: interceptor.context ? "_context" : undefined })});\n`; } } code += this.callTapsSeries({ onError, onResult: (i, result, next, doneBreak) => { let code = ""; code += `if(${result} !== undefined) {\n`; code += "_loop = true;\n"; if (!syncOnly) code += "if(_loopAsync) _looper();\n"; code += doneBreak(true); code += `} else {\n`; code += next(); code += `}\n`; return code; }, onDone: onDone && (() => { let code = ""; code += "if(!_loop) {\n"; code += onDone(); code += "}\n"; return code; }), rethrowIfPossible: rethrowIfPossible && syncOnly }); code += "} while(_loop);\n"; if (!syncOnly) { code += "_loopAsync = true;\n"; code += "});\n"; code += "_looper();\n"; } return code; } callTapsParallel({ onError, onResult, onDone, rethrowIfPossible, onTap = (i, run) => run() }) { if (this.options.taps.length <= 1) { return this.callTapsSeries({ onError, onResult, onDone, rethrowIfPossible }); } let code = ""; code += "do {\n"; code += `var _counter = ${this.options.taps.length};\n`; if (onDone) { code += "var _done = (function() {\n"; code += onDone(); code += "});\n"; } for (let i = 0; i < this.options.taps.length; i++) { const done = () => { if (onDone) return "if(--_counter === 0) _done();\n"; else return "--_counter;"; }; const doneBreak = skipDone => { if (skipDone || !onDone) return "_counter = 0;\n"; else return "_counter = 0;\n_done();\n"; }; code += "if(_counter <= 0) break;\n"; code += onTap( i, () => this.callTap(i, { onError: error => { let code = ""; code += "if(_counter > 0) {\n"; code += onError(i, error, done, doneBreak); code += "}\n"; return code; }, onResult: onResult && (result => { let code = ""; code += "if(_counter > 0) {\n"; code += onResult(i, result, done, doneBreak); code += "}\n"; return code; }), onDone: !onResult && (() => { return done(); }), rethrowIfPossible }), done, doneBreak ); } code += "} while(false);\n"; return code; } args({ before, after } = {}) { let allArgs = this._args; if (before) allArgs = [before].concat(allArgs); if (after) allArgs = allArgs.concat(after); if (allArgs.length === 0) { return ""; } else { return allArgs.join(", "); } } getTapFn(idx) { return `_x[${idx}]`; } getTap(idx) { return `_taps[${idx}]`; } getInterceptor(idx) { return `_interceptors[${idx}]`; } } module.exports = HookCodeFactory; /***/ }), /***/ 81647: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const util = __webpack_require__(31669); const defaultFactory = (key, hook) => hook; class HookMap { constructor(factory, name = undefined) { this._map = new Map(); this.name = name; this._factory = factory; this._interceptors = []; } get(key) { return this._map.get(key); } for(key) { const hook = this.get(key); if (hook !== undefined) { return hook; } let newHook = this._factory(key); const interceptors = this._interceptors; for (let i = 0; i < interceptors.length; i++) { newHook = interceptors[i].factory(key, newHook); } this._map.set(key, newHook); return newHook; } intercept(interceptor) { this._interceptors.push( Object.assign( { factory: defaultFactory }, interceptor ) ); } } HookMap.prototype.tap = util.deprecate(function(key, options, fn) { return this.for(key).tap(options, fn); }, "HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead."); HookMap.prototype.tapAsync = util.deprecate(function(key, options, fn) { return this.for(key).tapAsync(options, fn); }, "HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead."); HookMap.prototype.tapPromise = util.deprecate(function(key, options, fn) { return this.for(key).tapPromise(options, fn); }, "HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead."); module.exports = HookMap; /***/ }), /***/ 63708: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); class MultiHook { constructor(hooks, name = undefined) { this.hooks = hooks; this.name = name; } tap(options, fn) { for (const hook of this.hooks) { hook.tap(options, fn); } } tapAsync(options, fn) { for (const hook of this.hooks) { hook.tapAsync(options, fn); } } tapPromise(options, fn) { for (const hook of this.hooks) { hook.tapPromise(options, fn); } } isUsed() { for (const hook of this.hooks) { if (hook.isUsed()) return true; } return false; } intercept(interceptor) { for (const hook of this.hooks) { hook.intercept(interceptor); } } withOptions(options) { return new MultiHook( this.hooks.map(h => h.withOptions(options)), this.name ); } } module.exports = MultiHook; /***/ }), /***/ 98034: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class SyncBailHookCodeFactory extends HookCodeFactory { content({ onError, onResult, resultReturns, onDone, rethrowIfPossible }) { return this.callTapsSeries({ onError: (i, err) => onError(err), onResult: (i, result, next) => `if(${result} !== undefined) {\n${onResult( result )};\n} else {\n${next()}}\n`, resultReturns, onDone, rethrowIfPossible }); } } const factory = new SyncBailHookCodeFactory(); const TAP_ASYNC = () => { throw new Error("tapAsync is not supported on a SyncBailHook"); }; const TAP_PROMISE = () => { throw new Error("tapPromise is not supported on a SyncBailHook"); }; const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function SyncBailHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = SyncBailHook; hook.tapAsync = TAP_ASYNC; hook.tapPromise = TAP_PROMISE; hook.compile = COMPILE; return hook; } SyncBailHook.prototype = null; module.exports = SyncBailHook; /***/ }), /***/ 35079: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class SyncHookCodeFactory extends HookCodeFactory { content({ onError, onDone, rethrowIfPossible }) { return this.callTapsSeries({ onError: (i, err) => onError(err), onDone, rethrowIfPossible }); } } const factory = new SyncHookCodeFactory(); const TAP_ASYNC = () => { throw new Error("tapAsync is not supported on a SyncHook"); }; const TAP_PROMISE = () => { throw new Error("tapPromise is not supported on a SyncHook"); }; const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function SyncHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = SyncHook; hook.tapAsync = TAP_ASYNC; hook.tapPromise = TAP_PROMISE; hook.compile = COMPILE; return hook; } SyncHook.prototype = null; module.exports = SyncHook; /***/ }), /***/ 66953: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class SyncLoopHookCodeFactory extends HookCodeFactory { content({ onError, onDone, rethrowIfPossible }) { return this.callTapsLooping({ onError: (i, err) => onError(err), onDone, rethrowIfPossible }); } } const factory = new SyncLoopHookCodeFactory(); const TAP_ASYNC = () => { throw new Error("tapAsync is not supported on a SyncLoopHook"); }; const TAP_PROMISE = () => { throw new Error("tapPromise is not supported on a SyncLoopHook"); }; const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function SyncLoopHook(args = [], name = undefined) { const hook = new Hook(args, name); hook.constructor = SyncLoopHook; hook.tapAsync = TAP_ASYNC; hook.tapPromise = TAP_PROMISE; hook.compile = COMPILE; return hook; } SyncLoopHook.prototype = null; module.exports = SyncLoopHook; /***/ }), /***/ 92878: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ const Hook = __webpack_require__(36591); const HookCodeFactory = __webpack_require__(85572); class SyncWaterfallHookCodeFactory extends HookCodeFactory { content({ onError, onResult, resultReturns, rethrowIfPossible }) { return this.callTapsSeries({ onError: (i, err) => onError(err), onResult: (i, result, next) => { let code = ""; code += `if(${result} !== undefined) {\n`; code += `${this._args[0]} = ${result};\n`; code += `}\n`; code += next(); return code; }, onDone: () => onResult(this._args[0]), doneReturns: resultReturns, rethrowIfPossible }); } } const factory = new SyncWaterfallHookCodeFactory(); const TAP_ASYNC = () => { throw new Error("tapAsync is not supported on a SyncWaterfallHook"); }; const TAP_PROMISE = () => { throw new Error("tapPromise is not supported on a SyncWaterfallHook"); }; const COMPILE = function(options) { factory.setup(this, options); return factory.create(options); }; function SyncWaterfallHook(args = [], name = undefined) { if (args.length < 1) throw new Error("Waterfall hooks must have at least one argument"); const hook = new Hook(args, name); hook.constructor = SyncWaterfallHook; hook.tapAsync = TAP_ASYNC; hook.tapPromise = TAP_PROMISE; hook.compile = COMPILE; return hook; } SyncWaterfallHook.prototype = null; module.exports = SyncWaterfallHook; /***/ }), /***/ 34718: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ exports.__esModule = true; exports.SyncHook = __webpack_require__(35079); exports.SyncBailHook = __webpack_require__(98034); exports.SyncWaterfallHook = __webpack_require__(92878); exports.SyncLoopHook = __webpack_require__(66953); exports.AsyncParallelHook = __webpack_require__(82890); exports.AsyncParallelBailHook = __webpack_require__(28339); exports.AsyncSeriesHook = __webpack_require__(45146); exports.AsyncSeriesBailHook = __webpack_require__(97681); exports.AsyncSeriesLoopHook = __webpack_require__(5463); exports.AsyncSeriesWaterfallHook = __webpack_require__(73448); exports.HookMap = __webpack_require__(81647); exports.MultiHook = __webpack_require__(63708); /***/ }), /***/ 97220: /***/ (function(module) { /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ const e=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=$e,module.exports.default=$e;const t={amd:{$ref:"#/definitions/Amd"},bail:{$ref:"#/definitions/Bail"},cache:{$ref:"#/definitions/CacheOptions"},context:{$ref:"#/definitions/Context"},dependencies:{$ref:"#/definitions/Dependencies"},devServer:{$ref:"#/definitions/DevServer"},devtool:{$ref:"#/definitions/DevTool"},entry:{$ref:"#/definitions/Entry"},experiments:{$ref:"#/definitions/Experiments"},externals:{$ref:"#/definitions/Externals"},externalsPresets:{$ref:"#/definitions/ExternalsPresets"},externalsType:{$ref:"#/definitions/ExternalsType"},ignoreWarnings:{$ref:"#/definitions/IgnoreWarnings"},infrastructureLogging:{$ref:"#/definitions/InfrastructureLogging"},loader:{$ref:"#/definitions/Loader"},mode:{$ref:"#/definitions/Mode"},module:{$ref:"#/definitions/ModuleOptions"},name:{$ref:"#/definitions/Name"},node:{$ref:"#/definitions/Node"},optimization:{$ref:"#/definitions/Optimization"},output:{$ref:"#/definitions/Output"},parallelism:{$ref:"#/definitions/Parallelism"},performance:{$ref:"#/definitions/Performance"},plugins:{$ref:"#/definitions/Plugins"},profile:{$ref:"#/definitions/Profile"},recordsInputPath:{$ref:"#/definitions/RecordsInputPath"},recordsOutputPath:{$ref:"#/definitions/RecordsOutputPath"},recordsPath:{$ref:"#/definitions/RecordsPath"},resolve:{$ref:"#/definitions/Resolve"},resolveLoader:{$ref:"#/definitions/ResolveLoader"},snapshot:{$ref:"#/definitions/SnapshotOptions"},stats:{$ref:"#/definitions/StatsValue"},target:{$ref:"#/definitions/Target"},watch:{$ref:"#/definitions/Watch"},watchOptions:{$ref:"#/definitions/WatchOptions"}},n=Object.prototype.hasOwnProperty,r={allowCollectingMemory:{type:"boolean"},buildDependencies:{type:"object",additionalProperties:{type:"array",items:{type:"string",minLength:1}}},cacheDirectory:{type:"string",absolutePath:!0},cacheLocation:{type:"string",absolutePath:!0},compression:{enum:[!1,"gzip","brotli"]},hashAlgorithm:{type:"string"},idleTimeout:{type:"number",minimum:0},idleTimeoutAfterLargeChanges:{type:"number",minimum:0},idleTimeoutForInitialStore:{type:"number",minimum:0},immutablePaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},managedPaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},maxAge:{type:"number",minimum:0},maxMemoryGenerations:{type:"number",minimum:0},memoryCacheUnaffected:{type:"boolean"},name:{type:"string"},profile:{type:"boolean"},store:{enum:["pack"]},type:{enum:["filesystem"]},version:{type:"string"}};function s(t,{instancePath:o="",parentData:a,parentDataProperty:i,rootData:l=t}={}){let p=null,f=0;const u=f;let c=!1;const m=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var y=m===f;if(c=c||y,!c){const s=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let e;if(void 0===t.type&&(e="type")){const t={params:{missingProperty:e}};null===p?p=[t]:p.push(t),f++}else{const e=f;for(const e in t)if("cacheUnaffected"!==e&&"maxGenerations"!==e&&"type"!==e){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(e===f){if(void 0!==t.cacheUnaffected){const e=f;if("boolean"!=typeof t.cacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var h=e===f}else h=!0;if(h){if(void 0!==t.maxGenerations){let e=t.maxGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<1||isNaN(e)){const e={params:{comparison:">=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(y=s===f,c=c||y,!c){const s=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let s;if(void 0===t.type&&(s="type")){const e={params:{missingProperty:s}};null===p?p=[e]:p.push(e),f++}else{const s=f;for(const e in t)if(!n.call(r,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(s===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var d=e===f}else d=!0;if(d){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d){if(void 0!==t.memoryCacheUnaffected){const e=f;if("boolean"!=typeof t.memoryCacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0;if(d)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}y=s===f,c=c||y}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,s.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),s.errors=p,0===f}function o(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:a=e}={}){let i=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=u===l;if(f=f||c,!f){const o=l;s(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:a})||(i=null===i?s.errors:i.concat(s.errors),l=i.length),c=o===l,f=f||c}if(!f){const e={params:{}};return null===i?i=[e]:i.push(e),l++,o.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),o.errors=i,0===l}const a={asyncChunks:{type:"boolean"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}};function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const l=a;let p=!1;const f=a;if(!1!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(p=p||u,!p){const t=a,n=a;let r=!1;const s=a;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var c=s===a;if(r=r||c,!r){const t=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a,r=r||c}if(r)a=n,null!==o&&(n?o.length=n:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}u=t===a,p=p||u}if(!p){const e={params:{}};return null===o?o=[e]:o.push(e),a++,i.errors=o,!1}return a=l,null!==o&&(l?o.length=l:o=null),i.errors=o,0===a}function l(t,{instancePath:n="",parentData:r,parentDataProperty:s,rootData:o=t}={}){let a=null,i=0;const p=i;let f=!1,u=null;const c=i,m=i;let y=!1;const h=i;if(i===h)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===a?a=[e]:a.push(e),i++}else if(t.length<1){const e={params:{}};null===a?a=[e]:a.push(e),i++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),i++}var d=h===i;if(y=y||d,!y){const e=i;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),i++}d=e===i,y=y||d}if(y)i=m,null!==a&&(m?a.length=m:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),i++}if(c===i&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===a?a=[e]:a.push(e),i++,l.errors=a,!1}return i=p,null!==a&&(p?a.length=p:a=null),l.errors=a,0===i}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const f=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var u=f===a;if(l=l||u,!l){const t=a;if(a==a)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=a;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===o?o=[e]:o.push(e),a++;break}if(t===a){if(void 0!==e.amd){const t=a;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var c=t===a}else c=!0;if(c){if(void 0!==e.commonjs){const t=a;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c){if(void 0!==e.commonjs2){const t=a;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c)if(void 0!==e.root){const t=a;if("string"!=typeof e.root){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0}}}}else{const e={params:{type:"object"}};null===o?o=[e]:o.push(e),a++}u=t===a,l=l||u}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,p.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),p.errors=o,0===a}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(a===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=o===f;if(s=s||g,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:o})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.import){let t=e.import;const n=f,r=f;let s=!1;const o=f;if(f===o)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=o===f;if(s=s||v,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let s=!1;const o=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=o===f;if(s=s||D,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,s=s||D}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:o})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:o})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),h=n===f}else h=!0;if(h){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let s=!1;const o=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=o===f;if(s=s||P,!s){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,y.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),h=n===f}else h=!0;if(h)if(void 0!==e.wasmLoading){const n=f;m(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:o})||(p=null===p?m.errors:p.concat(m.errors),f=p.length),h=n===f}else h=!0}}}}}}}}}}}}return y.errors=p,0===f}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return h.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=a,u=a;let c=!1;const m=a,d=a;let g=!1;const b=a;if(a===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var i=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let s=r[t];if("string"==typeof s){if("number"==typeof n[s]){e=n[s];const r={params:{i:t,j:e}};null===o?o=[r]:o.push(r),a++;break}n[s]=t}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var l=b===a;if(g=g||l,!g){const e=a;if(a===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}l=e===a,g=g||l}if(g)a=d,null!==o&&(d?o.length=d:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}var p=m===a;if(c=c||p,!c){const i=a;y(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:s})||(o=null===o?y.errors:o.concat(y.errors),a=o.length),p=i===a,c=c||p}if(!c){const e={params:{}};return null===o?o=[e]:o.push(e),a++,h.errors=o,!1}if(a=u,null!==o&&(u?o.length=u:o=null),f!==a)break}}return h.errors=o,0===a}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const f=a,u=a;let c=!1;const m=a;if(a===m)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var y=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=e[n];if("string"==typeof s){if("number"==typeof r[s]){t=r[s];const e={params:{i:n,j:t}};null===o?o=[e]:o.push(e),a++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var h=m===a;if(c=c||h,!c){const t=a;if(a===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}h=t===a,c=c||h}if(c)a=u,null!==o&&(u?o.length=u:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}if(f===a&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===o?o=[e]:o.push(e),a++,d.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),d.errors=o,0===a}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?h.errors:o.concat(h.errors),a=o.length);var f=p===a;if(l=l||f,!l){const i=a;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?d.errors:o.concat(d.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,g.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),g.errors=o,0===a}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof Function)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=p===a;if(l=l||f,!l){const i=a;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?g.errors:o.concat(g.errors),a=o.length),f=i===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,b.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),b.errors=o,0===a}const v={asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}},D=new RegExp("^https?://","u");function P(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const f=a;if(a==a)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var u=m===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var c=a===l;if(o=o||c,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=e===l,o=o||c}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return pe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var m=o===l;if(s=s||m,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(m=t===l,s=s||m,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}m=t===l,s=s||m}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var v=c===l;if(u=u||v,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}v=t===l,u=u||v}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var D=o===l;if(s=s||D,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(D=t===l,s=s||D,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}D=t===l,s=s||D}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){const e=l;if("number"!=typeof t.priority)return pe.errors=[{params:{type:"number"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var P=o===l;if(s=s||P,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(P=t===l,s=s||P,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=t===l,s=s||P}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var A=o===l;if(s=s||A,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(A=t===l,s=s||A,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}A=t===l,s=s||A}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}}return pe.errors=i,0===l}function fe(t,{instancePath:r="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return fe.errors=[{params:{type:"object"}}],!1;{const s=l;for(const e in t)if(!n.call(ie,e))return fe.errors=[{params:{additionalProperty:e}}],!1;if(s===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return fe.errors=[{params:{type:"string"}}],!1;if(e.length<1)return fe.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,s=l,o=l;if(l===o)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===i?i=[e]:i.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const s=l;if(!(t instanceof RegExp)){const e={};null===i?i=[e]:i.push(e),l++}var f=s===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===i?i=[e]:i.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===i?i=[e]:i.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==i&&(n?i.length=n:i=null);else{const e={};null===i?i=[e]:i.push(e),l++}}}else{const e={};null===i?i=[e]:i.push(e),l++}if(o===l)return fe.errors=[{params:{}}],!1;if(l=s,null!==i&&(s?i.length=s:i=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return fe.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const s=l,o=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===i?i=[e]:i.push(e),l++}var u=f===l;if(p=p||u,!p){const s=l;if(!(n instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if("string"!=typeof n){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(u=s===l,p=p||u,!p){const s=l;pe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:a})||(i=null===i?pe.errors:i.concat(pe.errors),l=i.length),u=s===l,p=p||u}}}}if(!p){const e={params:{}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}if(l=o,null!==i&&(o?i.length=o:i=null),s!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=o===l;if(s=s||c,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=t===l,s=s||c}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return fe.errors=[{params:{type:"array"}}],!1;if(e.length<1)return fe.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return fe.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"chunks"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t&&"minSizeReduction"!==t)return fe.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return fe.errors=[{params:{type:"string"}}],!1;if(t.length<1)return fe.errors=[{params:{}}],!1}var y=n===l}else y=!0;if(y){if(void 0!==e.chunks){let t=e.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==t&&"async"!==t&&"all"!==t){const e={params:{}};null===i?i=[e]:i.push(e),l++}var h=o===l;if(s=s||h,!s){const e=l;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}h=e===l,s=s||h}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=u===l;if(f=f||d,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=e===l,f=f||d}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var v=u===l;if(f=f||v,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}v=e===l,f=f||v}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y)if(void 0!==e.minSizeReduction){let t=e.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var D=u===l;if(f=f||D,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}D=e===l,f=f||D}if(f)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0}}}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var P=a===l;if(o=o||P,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=e===l,o=o||P}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var j=c===l;if(u=u||j,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}j=t===l,u=u||j}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var S=c===l;if(u=u||S,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}S=t===l,u=u||S}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var C=c===l;if(u=u||C,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}C=t===l,u=u||C}if(u)l=f,null!==i&&(f?i.length=f:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var O=o===l;if(s=s||O,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(O=t===l,s=s||O,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}O=t===l,s=s||O}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,fe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}return fe.errors=i,0===l}function ue(e,{instancePath:t="",parentData:r,parentDataProperty:s,rootData:o=e}={}){let a=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;{const r=i;for(const t in e)if(!n.call(ae,t))return ue.errors=[{params:{additionalProperty:t}}],!1;if(r===i){if(void 0!==e.checkWasmTypes){const t=i;if("boolean"!=typeof e.checkWasmTypes)return ue.errors=[{params:{type:"boolean"}}],!1;var l=t===i}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=i;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return ue.errors=[{params:{}}],!1;l=n===i}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=i;if("boolean"!=typeof e.concatenateModules)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=i;if("boolean"!=typeof e.emitOnErrors)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=i;if("boolean"!=typeof e.flagIncludedChunks)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.innerGraph){const t=i;if("boolean"!=typeof e.innerGraph)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=i,r=i;let s=!1;const o=i;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===a?a=[e]:a.push(e),i++}var p=o===i;if(s=s||p,!s){const e=i;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===a?a=[e]:a.push(e),i++}p=e===i,s=s||p}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),i++,ue.errors=a,!1}i=r,null!==a&&(r?a.length=r:a=null),l=n===i}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=i;if("boolean"!=typeof e.mangleWasmImports)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=i;if("boolean"!=typeof e.mergeDuplicateChunks)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimize){const t=i;if("boolean"!=typeof e.minimize)return ue.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=i;if(i===n){if(!Array.isArray(t))return ue.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}y=n===f}else y=!0;if(y){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let s=!1;const o=f;if(f===o)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=o===f;if(s=s||v,!s){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,s=s||v}if(!s){const e={params:{}};return null===l?l=[e]:l.push(e),f++,De.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),y=n===f}else y=!0;if(y){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return De.errors=[{params:{type:"string"}}],!1;if(e.length<1)return De.errors=[{params:{}}],!1}y=n===f}else y=!0;if(y){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return De.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return De.errors=[{params:{}}],!1}y=r===f}else y=!0;if(y){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return De.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return De.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return De.errors=[{params:{}}],!1}y=r===f}else y=!0;if(y){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return De.errors=[{params:{type:"boolean"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return De.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return De.errors=[{params:{type:"string"}}],!1;y=e===f}else y=!0;if(y){if(void 0!==t.library){const e=f;ve(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:a})||(l=null===l?ve.errors:l.concat(ve.errors),f=l.length),y=e===f}else y=!0;if(y){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let s=!1,o=null;const a=f,i=f;let p=!1;const u=f;if(f===u)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;Pe(r.performance,{instancePath:s+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?Pe.errors:p.concat(Pe.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;Ae(r.plugins,{instancePath:s+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?Ae.errors:p.concat(Ae.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return $e.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var g=a===f;if(o=o||g,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=n===f,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,$e.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var v=a===f;if(o=o||v,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=n===f,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,$e.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,s=f;let o=!1;const a=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=a===f;if(o=o||D,!o){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=n===f,o=o||D}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,$e.errors=p,!1}f=s,null!==p&&(s?p.length=s:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;xe(r.resolve,{instancePath:s+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?xe.errors:p.concat(xe.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;ke(r.resolveLoader,{instancePath:s+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?ke.errors:p.concat(ke.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return $e.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return $e.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return $e.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return $e.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return $e.errors=[{params:{type:"boolean"}}],!1;var P=t===f}else P=!0;if(P)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return $e.errors=[{params:{type:"boolean"}}],!1;P=t===f}else P=!0}}}var A=n===f}else A=!0;if(A){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return $e.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r=",limit:1}}],!1}u=s===l}else u=!0;if(u)if(void 0!==r.hashFunction){let t=r.hashFunction;const s=l,n=l;let a=!1,i=null;const p=l,h=l;let c=!1;const m=l;if(l===m)if("string"==typeof t){if(t.length<1){const t={params:{}};null===o?o=[t]:o.push(t),l++}}else{const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}var f=m===l;if(c=c||f,!c){const e=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=e===l,c=c||f}if(c)l=h,null!==o&&(h?o.length=h:o=null);else{const t={params:{}};null===o?o=[t]:o.push(t),l++}if(p===l&&(a=!0,i=0),!a){const t={params:{passingSchemas:i}};return null===o?o=[t]:o.push(t),l++,e.errors=o,!1}l=n,null!==o&&(n?o.length=n:o=null),u=s===l}else u=!0}}}}}return e.errors=o,0===l}module.exports=e,module.exports.default=e; /***/ }), /***/ 21420: /***/ (function(module) { "use strict"; /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ function e(s,{instancePath:o="",parentData:r,parentDataProperty:t,rootData:n=s}={}){let c=null,a=0;const p=a;let l=!1;const i=a;if(a===i)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.resourceRegExp&&(e="resourceRegExp")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("contextRegExp"!==e&&"resourceRegExp"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a){if(void 0!==s.contextRegExp){const e=a;if(!(s.contextRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}var u=e===a}else u=!0;if(u)if(void 0!==s.resourceRegExp){const e=a;if(!(s.resourceRegExp instanceof RegExp)){const e={params:{}};null===c?c=[e]:c.push(e),a++}u=e===a}else u=!0}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}var f=i===a;if(l=l||f,!l){const e=a;if(a===e)if(s&&"object"==typeof s&&!Array.isArray(s)){let e;if(void 0===s.checkResource&&(e="checkResource")){const s={params:{missingProperty:e}};null===c?c=[s]:c.push(s),a++}else{const e=a;for(const e in s)if("checkResource"!==e){const s={params:{additionalProperty:e}};null===c?c=[s]:c.push(s),a++;break}if(e===a&&void 0!==s.checkResource&&!(s.checkResource instanceof Function)){const e={params:{}};null===c?c=[e]:c.push(e),a++}}}else{const e={params:{type:"object"}};null===c?c=[e]:c.push(e),a++}f=e===a,l=l||f}if(!l){const s={params:{}};return null===c?c=[s]:c.push(s),a++,e.errors=c,!1}return a=p,null!==c&&(p?c.length=p:c=null),e.errors=c,0===a}module.exports=e,module.exports.default=e; /***/ }), /***/ 95306: /***/ (function(module) { "use strict"; /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const e=0;for(const e in t)if("parse"!==e)return r.errors=[{params:{additionalProperty:e}}],!1;if(0===e&&void 0!==t.parse&&!(t.parse instanceof Function))return r.errors=[{params:{}}],!1}return r.errors=null,!0}module.exports=r,module.exports.default=r; /***/ }), /***/ 36012: /***/ (function(module) { /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function e(t,{instancePath:o="",parentData:a,parentDataProperty:i,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return e.errors=[{params:{type:"object"}}],!1;if(void 0!==t.debug){const r=0;if("boolean"!=typeof t.debug)return e.errors=[{params:{type:"boolean"}}],!1;var s=0===r}else s=!0;if(s){if(void 0!==t.minimize){const r=0;if("boolean"!=typeof t.minimize)return e.errors=[{params:{type:"boolean"}}],!1;s=0===r}else s=!0;if(s)if(void 0!==t.options){let o=t.options;const a=0;if(0===a){if(!o||"object"!=typeof o||Array.isArray(o))return e.errors=[{params:{type:"object"}}],!1;if(void 0!==o.context){let t=o.context;if("string"!=typeof t)return e.errors=[{params:{type:"string"}}],!1;if(t.includes("!")||!0!==r.test(t))return e.errors=[{params:{}}],!1}}s=0===a}else s=!0}return e.errors=null,!0}module.exports=e,module.exports.default=e; /***/ }), /***/ 67916: /***/ (function(module) { "use strict"; /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ module.exports=t,module.exports.default=t;const e={activeModules:{type:"boolean"},dependencies:{type:"boolean"},dependenciesCount:{type:"number"},entries:{type:"boolean"},handler:{oneOf:[{$ref:"#/definitions/HandlerFunction"}]},modules:{type:"boolean"},modulesCount:{type:"number"},percentBy:{enum:["entries","modules","dependencies",null]},profile:{enum:[!0,!1,null]}},r=Object.prototype.hasOwnProperty;function n(t,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=t}={}){let i=null,p=0;if(0===p){if(!t||"object"!=typeof t||Array.isArray(t))return n.errors=[{params:{type:"object"}}],!1;{const o=p;for(const o in t)if(!r.call(e,o))return n.errors=[{params:{additionalProperty:o}}],!1;if(o===p){if(void 0!==t.activeModules){const e=p;if("boolean"!=typeof t.activeModules)return n.errors=[{params:{type:"boolean"}}],!1;var u=e===p}else u=!0;if(u){if(void 0!==t.dependencies){const e=p;if("boolean"!=typeof t.dependencies)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.dependenciesCount){const e=p;if("number"!=typeof t.dependenciesCount)return n.errors=[{params:{type:"number"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.entries){const e=p;if("boolean"!=typeof t.entries)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.handler){const e=p,r=p;let o=!1,s=null;const a=p;if(!(t.handler instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),p++}if(a===p&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===i?i=[e]:i.push(e),p++,n.errors=i,!1}p=r,null!==i&&(r?i.length=r:i=null),u=e===p}else u=!0;if(u){if(void 0!==t.modules){const e=p;if("boolean"!=typeof t.modules)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.modulesCount){const e=p;if("number"!=typeof t.modulesCount)return n.errors=[{params:{type:"number"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.percentBy){let e=t.percentBy;const r=p;if("entries"!==e&&"modules"!==e&&"dependencies"!==e&&null!==e)return n.errors=[{params:{}}],!1;u=r===p}else u=!0;if(u)if(void 0!==t.profile){let e=t.profile;const r=p;if(!0!==e&&!1!==e&&null!==e)return n.errors=[{params:{}}],!1;u=r===p}else u=!0}}}}}}}}}}return n.errors=i,0===p}function t(e,{instancePath:r="",parentData:o,parentDataProperty:s,rootData:a=e}={}){let l=null,i=0;const p=i;let u=!1;const f=i;n(e,{instancePath:r,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?n.errors:l.concat(n.errors),i=l.length);var c=f===i;if(u=u||c,!u){const r=i;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),i++}c=r===i,u=u||c}if(!u){const e={params:{}};return null===l?l=[e]:l.push(e),i++,t.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),t.errors=l,0===i} /***/ }), /***/ 27084: /***/ (function(module) { /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ const e=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=l,module.exports.default=l;const n={append:{anyOf:[{enum:[!1,null]},{type:"string",minLength:1}]},columns:{type:"boolean"},exclude:{oneOf:[{$ref:"#/definitions/rules"}]},fallbackModuleFilenameTemplate:{anyOf:[{type:"string",minLength:1},{instanceof:"Function"}]},fileContext:{type:"string"},filename:{anyOf:[{enum:[!1,null]},{type:"string",absolutePath:!1,minLength:1}]},include:{oneOf:[{$ref:"#/definitions/rules"}]},module:{type:"boolean"},moduleFilenameTemplate:{anyOf:[{type:"string",minLength:1},{instanceof:"Function"}]},namespace:{type:"string"},noSources:{type:"boolean"},publicPath:{type:"string"},sourceRoot:{type:"string"},test:{$ref:"#/definitions/rules"}},t=Object.prototype.hasOwnProperty;function s(e,{instancePath:n="",parentData:t,parentDataProperty:l,rootData:r=e}={}){let o=null,a=0;const i=a;let u=!1;const p=a;if(a===p)if(Array.isArray(e)){const n=e.length;for(let t=0;t=",limit:1}}],!1}s=0===n}else s=!0}}}}return r.errors=null,!0}module.exports=r,module.exports.default=r; /***/ }), /***/ 60902: /***/ (function(module) { "use strict"; /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ function r(e,{instancePath:t="",parentData:n,parentDataProperty:i,rootData:o=e}={}){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{let t;if(void 0===e.minChunkSize&&(t="minChunkSize"))return r.errors=[{params:{missingProperty:t}}],!1;{const t=0;for(const t in e)if("chunkOverhead"!==t&&"entryChunkMultiplicator"!==t&&"minChunkSize"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(0===t){if(void 0!==e.chunkOverhead){const t=0;if("number"!=typeof e.chunkOverhead)return r.errors=[{params:{type:"number"}}],!1;var a=0===t}else a=!0;if(a){if(void 0!==e.entryChunkMultiplicator){const t=0;if("number"!=typeof e.entryChunkMultiplicator)return r.errors=[{params:{type:"number"}}],!1;a=0===t}else a=!0;if(a)if(void 0!==e.minChunkSize){const t=0;if("number"!=typeof e.minChunkSize)return r.errors=[{params:{type:"number"}}],!1;a=0===t}else a=!0}}}}return r.errors=null,!0}module.exports=r,module.exports.default=r; /***/ }), /***/ 87387: /***/ (function(module) { /* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=n,module.exports.default=n;const t=new RegExp("^https?://","u");function e(n,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=n}={}){let i=null,p=0;if(0===p){if(!n||"object"!=typeof n||Array.isArray(n))return e.errors=[{params:{type:"object"}}],!1;{let o;if(void 0===n.allowedUris&&(o="allowedUris"))return e.errors=[{params:{missingProperty:o}}],!1;{const o=p;for(const r in n)if("allowedUris"!==r&&"cacheLocation"!==r&&"frozen"!==r&&"lockfileLocation"!==r&&"upgrade"!==r)return e.errors=[{params:{additionalProperty:r}}],!1;if(o===p){if(void 0!==n.allowedUris){let r=n.allowedUris;const o=p;if(p==p){if(!Array.isArray(r))return e.errors=[{params:{type:"array"}}],!1;{const n=r.length;for(let o=0;o